public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/16712] New: [3.5.0 regression] Segmentation fault when accessing const array
@ 2004-07-26  9:22 loki at inf dot u-szeged dot hu
  2004-07-26 13:35 ` [Bug c/16712] " bangerth at dealii dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: loki at inf dot u-szeged dot hu @ 2004-07-26  9:22 UTC (permalink / raw)
  To: gcc-bugs

With the following c source (foo.i) I have segmentation fault:
typedef struct
{
  char n[129];
} A;

const A C = {
  0,
  0
};

extern const A *const B;

void bar(const char *);

void foo ()
{
  bar (B->n);
}

const A *const B = &C;

Command line:
*gcc -c -O2 -o foo.i foo.c

Output:
foo.i: In function `foo':
foo.i:16: internal compiler error: Segmentation fault

-- 
           Summary: [3.5.0 regression] Segmentation fault when accessing
                    const array
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P1
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: loki at inf dot u-szeged dot hu
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: arm-unknown-elf  i386-unknown-elf m68k-unknown-elf mips-
                    unknown-


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


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

* [Bug c/16712] [3.5.0 regression] Segmentation fault when accessing const array
  2004-07-26  9:22 [Bug c/16712] New: [3.5.0 regression] Segmentation fault when accessing const array loki at inf dot u-szeged dot hu
@ 2004-07-26 13:35 ` bangerth at dealii dot org
  2004-07-26 13:40 ` loki at inf dot u-szeged dot hu
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bangerth at dealii dot org @ 2004-07-26 13:35 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-07-26 13:35 -------
I can't seem to reproduce this on my x86 linux box with a snapshot from 
2004-07-21. What is your version? And do you mean that you reproduced 
this bug on all the platforms you listed, i.e. 
  arm-unknown-elf  i386-unknown-elf m68k-unknown-elf mips-unknown- 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug c/16712] [3.5.0 regression] Segmentation fault when accessing const array
  2004-07-26  9:22 [Bug c/16712] New: [3.5.0 regression] Segmentation fault when accessing const array loki at inf dot u-szeged dot hu
  2004-07-26 13:35 ` [Bug c/16712] " bangerth at dealii dot org
@ 2004-07-26 13:40 ` loki at inf dot u-szeged dot hu
  2004-07-26 13:54 ` [Bug tree-optimization/16712] " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: loki at inf dot u-szeged dot hu @ 2004-07-26 13:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From loki at inf dot u-szeged dot hu  2004-07-26 13:40 -------
(In reply to comment #1)
> I can't seem to reproduce this on my x86 linux box with a snapshot from 
> 2004-07-21. What is your version? And do you mean that you reproduced 
> this bug on all the platforms you listed, i.e. 
>   arm-unknown-elf  i386-unknown-elf m68k-unknown-elf mips-unknown- 
Sorry, I forgot to write down the following:

Last known to work: 3.5.0 (2004-07-22 12:00:00 UTC)

First known to fail: 3.5.0 (2004-07-23 12:00:00 UTC)
Last known to fail: 3.5.0 (2004-07-25 12:00:00 UTC)



-- 


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


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

* [Bug tree-optimization/16712] [3.5.0 regression] Segmentation fault when accessing const array
  2004-07-26  9:22 [Bug c/16712] New: [3.5.0 regression] Segmentation fault when accessing const array loki at inf dot u-szeged dot hu
  2004-07-26 13:35 ` [Bug c/16712] " bangerth at dealii dot org
  2004-07-26 13:40 ` loki at inf dot u-szeged dot hu
@ 2004-07-26 13:54 ` pinskia at gcc dot gnu dot org
  2004-07-26 13:58 ` dnovillo at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-26 13:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-26 13:54 -------
Confirmed, here is the backtrace (I compiled with c++ for some reason but it does not matter):
#0  note_addressable (var=Variable "var" is not available.
) at /home/gates/pinskia/src/gnu/gcc/src/gcc/tree-ssa-operands.c:1434
#1  0x081e1259 in add_stmt_operand (var_p=0x4004f1ac, stmt=0x4004f18c, flags=0, 
prev_vops=0x0)
    at /home/gates/pinskia/src/gnu/gcc/src/gcc/tree-ssa-operands.c:1303
#2  0x081e1b37 in get_expr_operands (stmt=0x4004f18c, expr_p=0x4004f1ac, flags=0, 
prev_vops=0xbffebe70)
    at /home/gates/pinskia/src/gnu/gcc/src/gcc/tree-ssa-operands.c:859
#3  0x081e3789 in get_stmt_operands (stmt=0x4004f18c) at /home/gates/pinskia/src/gnu/gcc/src/
gcc/tree-ssa-operands.c:758
#4  0x0819c970 in mark_new_vars_to_rename (stmt=0x4004f18c, vars_to_rename=0x869a090) at /
home/gates/pinskia/src/gnu/gcc/src/gcc/tree-dfa.c:1051
#5  0x081d12d0 in tree_ssa_ccp () at /home/gates/pinskia/src/gnu/gcc/src/gcc/tree-ssa-ccp.c:435
#6  0x081a6132 in execute_pass_list (pass=0x85f1900) at /home/gates/pinskia/src/gnu/gcc/src/gcc/
tree-optimize.c:446
#7  0x081a6145 in execute_pass_list (pass=0x85f1700) at /home/gates/pinskia/src/gnu/gcc/src/gcc/
tree-optimize.c:472
#8  0x081a6332 in tree_rest_of_compilation (fndecl=0x4010715c, nested_p=0 '\0') at /home/gates/
pinskia/src/gnu/gcc/src/gcc/tree-optimize.c:547
#9  0x08128e88 in expand_body (fn=0x4010715c) at /home/gates/pinskia/src/gnu/gcc/src/gcc/cp/
semantics.c:2889
#10 0x084af668 in cgraph_expand_function (node=0x401076cc) at /home/gates/pinskia/src/gnu/
gcc/src/gcc/cgraphunit.c:797
#11 0x084b10bb in cgraph_optimize () at /home/gates/pinskia/src/gnu/gcc/src/gcc/cgraphunit.c:
1669
#12 0x080d4c5c in finish_file () at /home/gates/pinskia/src/gnu/gcc/src/gcc/cp/decl2.c:2877
#13 0x0817d1fa in c_common_parse_file (set_yydebug=0) at /home/gates/pinskia/src/gnu/gcc/src/
gcc/c-opts.c:1087
#14 0x0845dbde in toplev_main (argc=0, argv=0xbffec2a4) at /home/gates/pinskia/src/gnu/gcc/src/
gcc/toplev.c:981
#15 0x420174d9 in __libc_start_main () from /lib/i686/libc.so.6
#16 0x08049b31 in _start ()

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dnovillo at gcc dot gnu dot
                   |                            |org
             Status|WAITING                     |NEW
          Component|c                           |tree-optimization
     Ever Confirmed|                            |1
 GCC target triplet|arm-unknown-elf  i386-      |
                   |unknown-elf m68k-unknown-elf|
                   |mips-unknown-               |
           Keywords|                            |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-07-26 13:54:16
               date|                            |
   Target Milestone|---                         |3.5.0


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


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

* [Bug tree-optimization/16712] [3.5.0 regression] Segmentation fault when accessing const array
  2004-07-26  9:22 [Bug c/16712] New: [3.5.0 regression] Segmentation fault when accessing const array loki at inf dot u-szeged dot hu
                   ` (2 preceding siblings ...)
  2004-07-26 13:54 ` [Bug tree-optimization/16712] " pinskia at gcc dot gnu dot org
@ 2004-07-26 13:58 ` dnovillo at gcc dot gnu dot org
  2004-07-26 17:46 ` echristo at redhat dot com
  2004-07-27  0:20 ` echristo at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: dnovillo at gcc dot gnu dot org @ 2004-07-26 13:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From dnovillo at gcc dot gnu dot org  2004-07-26 13:58 -------

May be related to a similar failure that echristo found last week.  Eric, does
your fix address this problem?


Diego.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |echristo at redhat dot com


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


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

* [Bug tree-optimization/16712] [3.5.0 regression] Segmentation fault when accessing const array
  2004-07-26  9:22 [Bug c/16712] New: [3.5.0 regression] Segmentation fault when accessing const array loki at inf dot u-szeged dot hu
                   ` (3 preceding siblings ...)
  2004-07-26 13:58 ` dnovillo at gcc dot gnu dot org
@ 2004-07-26 17:46 ` echristo at redhat dot com
  2004-07-27  0:20 ` echristo at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: echristo at redhat dot com @ 2004-07-26 17:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From echristo at redhat dot com  2004-07-26 17:46 -------
Yeah. My patch fixes it. I'll take this until I can commit.

Thanks.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2004-07-26 13:54:16         |2004-07-26 17:46:03
               date|                            |


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


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

* [Bug tree-optimization/16712] [3.5.0 regression] Segmentation fault when accessing const array
  2004-07-26  9:22 [Bug c/16712] New: [3.5.0 regression] Segmentation fault when accessing const array loki at inf dot u-szeged dot hu
                   ` (4 preceding siblings ...)
  2004-07-26 17:46 ` echristo at redhat dot com
@ 2004-07-27  0:20 ` echristo at redhat dot com
  5 siblings, 0 replies; 7+ messages in thread
From: echristo at redhat dot com @ 2004-07-27  0:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From echristo at redhat dot com  2004-07-27 00:20 -------
Fixed with:

2004-07-26  Eric Christopher  <echristo@redhat.com>

	* tree-dfa.c (add_referenced_var): Register initializers of global
	variables.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2004-07-27  0:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-26  9:22 [Bug c/16712] New: [3.5.0 regression] Segmentation fault when accessing const array loki at inf dot u-szeged dot hu
2004-07-26 13:35 ` [Bug c/16712] " bangerth at dealii dot org
2004-07-26 13:40 ` loki at inf dot u-szeged dot hu
2004-07-26 13:54 ` [Bug tree-optimization/16712] " pinskia at gcc dot gnu dot org
2004-07-26 13:58 ` dnovillo at gcc dot gnu dot org
2004-07-26 17:46 ` echristo at redhat dot com
2004-07-27  0:20 ` echristo at redhat dot com

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).