This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/15549] New: true !< 'a'
- From: "flash at pobox dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 May 2004 04:54:10 -0000
- Subject: [Bug c/15549] New: true !< 'a'
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
static volatile bool arg1__Bool_1475 = true;
volatile const static uint_least8_t arg2_char_1479 = 'a';
printf( " \t %s %d \n " , "" , arg1__Bool_1475 < arg2_char_1479 );
gives 0, not 1, on GNU C version 3.3 20030304 (Apple Computer, Inc. build 1495).
Originally found in C99 mode, but also with default flags.
gcc version 2.96 20000731 (Red Hat Linux 7.2 2.96-112.7.2) behaves as expected.
(The extra %s and empty string are for alignment issues on another platform.)
Commands:
gcc ../c/noerror/bugfiles/gcc_bool_bug.c
a.out
1 < 97 ( arg1__Bool_1475 < arg2_char_1479 ) :
0
Full source:
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
int main() {
//...
static volatile bool arg1__Bool_1475 = true;
//...
volatile const static uint_least8_t arg2_char_1479 = 'a';
printf( " %s %d" , "" , arg1__Bool_1475 );
printf( "%s < %d ( arg1__Bool_1475 < arg2_char_1479 ) : \n " , "" , arg2_char_1479 );
printf( " \t %s %d \n " , "" , arg1__Bool_1475 < arg2_char_1479 );
//...
return 42;
}
Pre-processed file to follow, once I figure out how; here's the session:
gcc -v -save-temps ../c/noerror/bugfiles/gcc_bool_bug.c
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)
/usr/libexec/gcc/darwin/ppc/3.3/cc1 -E -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3
-D__GNUC_PATCHLEVEL__=0 -D__APPLE_CC__=1495 -D__DYNAMIC__ ../c/noerror/bugfiles/
gcc_bool_bug.c -fPIC gcc_bool_bug.i
ignoring nonexistent directory "/usr/ppc-darwin/include"
ignoring nonexistent directory "/Local/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/include/gcc/darwin/3.3
/usr/include
End of search list.
Framework search starts here:
/System/Library/Frameworks
/Library/Frameworks
End of framework search list.
/usr/libexec/gcc/darwin/ppc/3.3/cc1 -fpreprocessed gcc_bool_bug.i -fPIC -quiet -dumpbase
gcc_bool_bug.c -auxbase gcc_bool_bug -version -o gcc_bool_bug.s
GNU C version 3.3 20030304 (Apple Computer, Inc. build 1495) (ppc-darwin)
compiled by GNU C version 3.3 20030304 (Apple Computer, Inc. build 1495).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=131072
/usr/libexec/gcc/darwin/ppc/as -arch ppc -o gcc_bool_bug.o gcc_bool_bug.s
ld -arch ppc -dynamic -o a.out -lcrt1.o -lcrt2.o -L/usr/lib/gcc/darwin/3.3 -L/usr/lib/gcc/darwin -L/
usr/libexec/gcc/darwin/ppc/3.3/../../.. gcc_bool_bug.o -lgcc -lSystem |
c++filt3
--
Summary: true !< 'a'
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: flash at pobox dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: ppc-darwin/3.3 20030304 (OSX 10.3.3)
GCC host triplet: ppc-darwin/3.3 20030304 (OSX 10.3.3)
GCC target triplet: ppc-darwin/3.3 20030304 (OSX 10.3.3)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15549