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:34 ` [Bug c/31702] " eweddington at cso dot atmel dot com
  2007-04-25 15:37 ` [Bug target/31702] " pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 4+ 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] 4+ messages in thread

* [Bug c/31702] Pointer Arithmetic Crash When Optimizing
  2007-04-25 14:09 [Bug c/31702] New: Pointer Arithmetic Crash When Optimizing r dot slater at freescale dot com
@ 2007-04-25 15:34 ` eweddington at cso dot atmel dot com
  2007-04-25 15:37 ` [Bug target/31702] " pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 4+ messages in thread
From: eweddington at cso dot atmel dot com @ 2007-04-25 15:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from eweddington at cso dot atmel dot com  2007-04-25 16:34 -------
This is very probably an mcore target issue. The test case passes for the AVR
target for 4.1.1 and 4.1.2 with all -O settings (0,1,2,3,s).


-- 


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


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

* [Bug target/31702] Pointer Arithmetic Crash When Optimizing
  2007-04-25 14:09 [Bug c/31702] New: Pointer Arithmetic Crash When Optimizing r dot slater at freescale dot com
  2007-04-25 15:34 ` [Bug c/31702] " eweddington at cso dot atmel dot com
@ 2007-04-25 15:37 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-04-25 15:37 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal
          Component|c                           |target
           Keywords|                            |ice-on-valid-code


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


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

* [Bug target/31702] Pointer Arithmetic Crash When Optimizing
       [not found] <bug-31702-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-15  3:00 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-15  3:00 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 25690.

*** This bug has been marked as a duplicate of bug 25690 ***

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

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

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