http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59649
Bug ID: 59649 Summary: [4.9 regression] conftest.c miscompiled Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: build, wrong-code Severity: critical Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: sch...@linux-m68k.org CC: nickc at gcc dot gnu.org Blocks: 59613 Target: ia64-*-* >From ia64-suse-linux/libgomp/config.log: configure:16188: /usr/local/gcc/test/Build/./gcc/xgcc -B/usr/local/gcc/test/Build/./gcc/ -B/usr/ia64-suse-linux/bin/ -B/usr/ia64-suse-linux/lib/ -isystem /usr/ia64-suse-linux/include -isystem /usr/ia64-suse-linux/sys-include -o conftest -g -O2 -include confdefs.h -include ../../../libgomp/config/linux/omp-lock.h conftest.c -lrt >&5 configure:16188: $? = 0 configure:16188: ./conftest configure:16188: $? = 1 configure: program exited with status 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "GNU OpenMP Runtime Library" | #define PACKAGE_TARNAME "libgomp" | #define PACKAGE_VERSION "1.0" | #define PACKAGE_STRING "GNU OpenMP Runtime Library 1.0" | #define PACKAGE_BUGREPORT "" | #define PACKAGE_URL "http://www.gnu.org/software/libgomp/" | #define PACKAGE "libgomp" | #define VERSION "1.0" | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | #define TIME_WITH_SYS_TIME 1 | #define STRING_WITH_STRINGS 1 | #define HAVE_UNISTD_H 1 | #define HAVE_SEMAPHORE_H 1 | #define HAVE_SYS_TIME_H 1 | #define HAVE_SYS_TIME_H 1 | #define HAVE_GETLOADAVG 1 | #define HAVE_STRTOULL 1 | #define HAVE_PTHREAD_AFFINITY_NP 1 | #define HAVE_CLOCK_GETTIME 1 | #define HAVE_TLS 1 | #define HAVE_ATTRIBUTE_VISIBILITY 1 | #define HAVE_ATTRIBUTE_ALIAS 1 | #define HAVE_AS_SYMVER_DIRECTIVE 1 | #define HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT 1 | #define LIBGOMP_GNU_SYMBOL_VERSIONING 1 | #define HAVE_SYNC_BUILTINS 1 | /* end confdefs.h. */ | | static long int longval () { return sizeof (omp_lock_t); } | static unsigned long int ulongval () { return sizeof (omp_lock_t); } | #include <stdio.h> | #include <stdlib.h> | int | main () | { | | FILE *f = fopen ("conftest.val", "w"); | if (! f) | return 1; | if ((sizeof (omp_lock_t)) < 0) | { | long int i = longval (); | if (i != (sizeof (omp_lock_t))) | return 1; | fprintf (f, "%ld", i); | } | else | { | unsigned long int i = ulongval (); | if (i != (sizeof (omp_lock_t))) | return 1; | fprintf (f, "%lu", i); | } | /* Do not output a trailing newline, as this causes \r\n confusion | on some platforms. */ | return ferror (f) || fclose (f) != 0; | | ; | return 0; | } configure:16191: error: unsupported system, cannot find sizeof (omp_lock_t) The test program is miscompiled to always return 1. (gdb) disass main Dump of assembler code for function main: 0x4000000000000600 <+0>: [MMB] alloc r34=ar.pfs,7,4,0 0x4000000000000601 <+1>: addl r37=288,r1 0x4000000000000602 <+2>: nop.b 0x0 0x4000000000000610 <+16>: [MII] addl r36=280,r1 0x4000000000000611 <+17>: mov r33=b0 0x4000000000000612 <+18>: mov r35=r1;; 0x4000000000000620 <+32>: [MMI] nop.m 0x0 0x4000000000000621 <+33>: ld8 r37=[r37] 0x4000000000000622 <+34>: nop.i 0x0 0x4000000000000630 <+48>: [MMB] ld8 r36=[r36] 0x4000000000000631 <+49>: nop.m 0x0 0x4000000000000632 <+50>: br.call.sptk.many b0=0x4000000000000540;; 0x4000000000000640 <+64>: [MMI] mov r1=r35 0x4000000000000641 <+65>: nop.m 0x0 0x4000000000000642 <+66>: mov r32=r8 0x4000000000000650 <+80>: [MII] mov r38=4 0x4000000000000651 <+81>: mov r36=r8;; 0x4000000000000652 <+82>: addl r37=296,r1;; 0x4000000000000660 <+96>: [MIB] ld8 r37=[r37] 0x4000000000000661 <+97>: nop.i 0x0 0x4000000000000662 <+98>: br.call.sptk.many b0=0x40000000000005c0;; 0x4000000000000670 <+112>: [MIB] mov r1=r35 0x4000000000000671 <+113>: mov r36=r32 0x4000000000000672 <+114>: br.call.sptk.many b0=0x4000000000000560;; 0x4000000000000680 <+128>: [MMI] mov r8=1 0x4000000000000681 <+129>: mov r1=r35 0x4000000000000682 <+130>: mov.i ar.pfs=r34;; 0x4000000000000690 <+144>: [MIB] nop.m 0x0 0x4000000000000691 <+145>: mov b0=r33 0x4000000000000692 <+146>: br.ret.sptk.many b0;;