public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/31702]  New: Pointer Arithmetic Crash When Optimizing
@ 2007-04-25 14:09 r dot slater at freescale dot com
  2007-04-25 15:37 ` [Bug target/31702] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: r dot slater at freescale dot com @ 2007-04-25 14:09 UTC (permalink / raw)
  To: gcc-bugs

Compilation *crashes* when -O argument is greater than 0 (i.e. -O1, -O2, or
-O3).
If -O0 is used (or -O is omitted) compilation *passes*.

Note that "a" below needs to be external to the function.  If the line "char*
a;" is placed inside the test() function, compilation *passes*.


REDUCED TEST CASE:

File "test.c":
char*  a;

void test()
{
  a = "0";
  a = a + 1;
  return;

}  /* test() */



OUTPUT:

mcore-elf-gcc -c -O2 test.c
test.c: In function 'test':
test.c:9: error: unrecognizable insn:
(insn 12 11 13 1 (set (reg:SI 26)
        (const:SI (plus:SI (symbol_ref/f:SI ("*.LC0") [flags 0x2] <string_cst
0xb72f54a0>)
                (const_int 1 [0x1])))) -1 (nil)
    (nil))
test.c:9: internal compiler error: in extract_insn, at recog.c:2084



GCC CONFIGURATION:

% mcore-elf-gcc -v
Using built-in specs.
Target: mcore-elf
Configured with: /tmp/bld/gcc/gcc-4.1.2/configure --target=mcore-elf
--enable-languages=c,c++ --enable-multilib --with-gnu-as --with-gnu-ld
--with-newlib
--prefix=/_TOOLS_/dist/gnu-gcc-4.1.2-binutils-2.17-mcore-elf/i686-pc-linux2.4
Thread model: single
gcc version 4.1.2


OTHER RELEASES:
Test case fails  in 4.1.1
Test case passes in 4.0.4


POSSIBLE DUPLICATES:
25690 -- Symptom is different (bug involves structure deference) but cause
might be the same (points to the same line of code in the compiler source)


-- 
           Summary: Pointer Arithmetic Crash When Optimizing
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: r dot slater at freescale dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: mcore-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31702


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-15  3:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-31702-4@http.gcc.gnu.org/bugzilla/>
2021-08-15  3:00 ` [Bug target/31702] Pointer Arithmetic Crash When Optimizing pinskia at gcc dot gnu.org
2007-04-25 14:09 [Bug c/31702] New: " r dot slater at freescale dot com
2007-04-25 15:37 ` [Bug target/31702] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).