GNU bug report logs -
#36370
27.0.50; XFIXNAT called on negative numbers
Previous Next
Reported by: Pip Cet <pipcet <at> gmail.com>
Date: Tue, 25 Jun 2019 05:37:02 UTC
Severity: normal
Tags: patch
Found in version 27.0.50
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi Paul,
> I'll CC: this to bug-gnulib since it's a Gnulib issue. I have not
> installed this patch into Gnulib on savannah.
Can you please show an example code on which the change makes a difference?
I used this test program
==================================== foo.c ====================================
#include <stdio.h>
//#define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
#define assume(R) (!__builtin_constant_p (!(R) == !(R)) || (R) ? (void) 0 : __builtin_unreachable ())
int f_generic (int i)
{
printf("%d\n", i & 0x80000000);
return 0;
}
int f_condition (int i)
{
if (i >= 0)
printf("%d\n", i & 0x80000000);
return 0;
}
int f_assume (int i)
{
assume (i >= 0);
printf("%d\n", i & 0x80000000);
return 0;
}
===============================================================================
$ gcc -O2 -m32 -S foo.c && fgrep -v .cfi foo.s
and the code is the same, regardless of which definition of 'assume' I enable.
Bruno
This bug report was last modified 6 years and 20 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.