This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
g++ -g -Wall -fPIC -O2 -funroll-loops -o /dev/null -c disk.cpp disk.cpp: In function 'char* test(const char*, const char*)': disk.cpp:13: error: unrecognizable insn: (insn 542 541 544 26 (set (reg/f:SI 84) (plus:SI (reg:SI 12 %r12) (const:SI (plus:SI (unspec:SI [ (symbol_ref:SI ("_ZZ4testPKcS0_E8rtn_path") [flags 0x2] <var_decl 0x77db29a0 rtn_path>) ] 112) (const_int 1024 [0x400]))))) -1 (nil) (nil)) disk.cpp:13: internal compiler error: in extract_insn, at recog.c:2084 Code: char *test(const char *parent, const char *child) { static char rtn_path[1024]; char *s = rtn_path; char *s_end = rtn_path + sizeof(rtn_path); const char *s2 = child; while( *s != '\0' ) s++; while( (s < s_end) && (*s2 != '\0') ) *s++ = *s2++; return(rtn_path); }
A regression hunt using an s390-linux cross compiler on powerpc-linux, with the submitter's testcase and options, identified this patch: http://gcc.gnu.org/viewcvs?view=rev&rev=88869 r88869 | pinskia | 2004-10-11 03:42:09 +0000 (Mon, 11 Oct 2004)
My patch just exposed a latent bug as it does nothing that was not already done before RTH removed the folding.
*** Bug 28717 has been marked as a duplicate of this bug. ***
Happens on mainline as well.
This was a P2 before the new Priority system came into effect so moving it to a P3.
Subject: Bug 24367 Author: krebbel Date: Thu Aug 31 07:43:36 2006 New Revision: 116599 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116599 Log: 2006-08-31 Andreas Krebbel <krebbel1@de.ibm.com> PR target/24367 * config/s390/s390.md ("movsi", "movdi" expander): Accept rtxes like r12 + SYMBOLIC_CONST. 2006-08-31 Andreas Krebbel <krebbel1@de.ibm.com> PR target/24367 * gcc.dg/pr24367.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/pr24367.c Modified: trunk/gcc/ChangeLog trunk/gcc/config/s390/s390.md trunk/gcc/testsuite/ChangeLog
Subject: Bug 24367 Author: krebbel Date: Thu Aug 31 07:50:19 2006 New Revision: 116600 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116600 Log: 2006-08-31 Andreas Krebbel <krebbel1@de.ibm.com> PR target/24367 * config/s390/s390.md ("movsi", "movdi" expander): Accept rtxes like r12 + SYMBOLIC_CONST. 2006-08-31 Andreas Krebbel <krebbel1@de.ibm.com> PR target/24367 * gcc.dg/pr24367.c: New testcase. Added: branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/pr24367.c Modified: branches/gcc-4_1-branch/gcc/ChangeLog branches/gcc-4_1-branch/gcc/config/s390/s390.md branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Although the bug is latent in gcc 4.0 as well I've applied the patch to 4.1 and 4.2 only. I could not reproduce a failure with gcc 4.0 so I've left it as is rather than risking new problems.