public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/14470] New: x86 optimizer error (?)
@ 2004-03-07 22:13 lvoge at cs dot vu dot nl
  2004-03-07 22:26 ` [Bug c/14470] " lvoge at cs dot vu dot nl
                   ` (52 more replies)
  0 siblings, 53 replies; 54+ messages in thread
From: lvoge at cs dot vu dot nl @ 2004-03-07 22:13 UTC (permalink / raw)
  To: gcc-bugs

excuse me if this is stupidity on my part or me not understanding C properly, but:

int main() {
        int t[123] = { 1024 }, d;

        d = 0;
        d = t[d]++;
        printf("%d\n", d);
        return 0;
}

dumps core when compiled with -O2 on intel. the trouble is that the fifth line
gets compiled as if it says d = t[d]; t[d]++;, it re-uses the register to index
the increment that just got the result of the dereference.

compiles and runs correctly with any optimization with the Intel compiler v7.0.
gcc without optimization runs correctly on intel. gcc on sparc64 and ppc with
any optimization also runs correctly.

-- 
           Summary: x86 optimizer error (?)
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lvoge at cs dot vu dot nl
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: GNU C version 3.3.3 (Debian) (i486-linux)
  GCC host triplet: GNU C version 3.3.3 (Debian) (i486-linux)
GCC target triplet: GNU C version 3.3.3 (Debian) (i486-linux)


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


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

end of thread, other threads:[~2004-09-18 15:44 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-07 22:13 [Bug c/14470] New: x86 optimizer error (?) lvoge at cs dot vu dot nl
2004-03-07 22:26 ` [Bug c/14470] " lvoge at cs dot vu dot nl
2004-03-07 22:36 ` bangerth at dealii dot org
2004-03-07 22:43 ` lvoge at cs dot vu dot nl
2004-03-07 22:56 ` giovannibajo at libero dot it
2004-03-07 23:12 ` falk at debian dot org
2004-03-07 23:19 ` lvoge at cs dot vu dot nl
2004-03-07 23:57 ` pinskia at gcc dot gnu dot org
2004-03-08  0:57 ` pinskia at gcc dot gnu dot org
2004-03-08  1:47 ` amodra at bigpond dot net dot au
2004-03-08  3:12 ` zack at gcc dot gnu dot org
2004-03-08  4:35 ` bangerth at dealii dot org
2004-03-08  5:05 ` giovannibajo at libero dot it
2004-03-08  5:30 ` zack at gcc dot gnu dot org
2004-03-08  9:13 ` [Bug optimization/14470] [3.4/3.5 regression] trouble with post-increment reichelt at gcc dot gnu dot org
2004-03-08  9:17 ` [Bug optimization/14470] [3.3/3.4/3.5 " reichelt at gcc dot gnu dot org
2004-03-08  9:37 ` ebotcazou at gcc dot gnu dot org
2004-03-08 10:13 ` jsm at polyomino dot org dot uk
2004-03-11  6:34 ` [Bug middle-end/14470] " ebotcazou at gcc dot gnu dot org
2004-03-13  2:53 ` [Bug middle-end/14470] [3.4 " gdr at gcc dot gnu dot org
2004-03-13  3:03 ` cvs-commit at gcc dot gnu dot org
2004-03-13 16:20 ` [Bug middle-end/14470] [3.4/3.5 regression] [tree-ssa] " mmitchel at gcc dot gnu dot org
2004-03-13 18:16 ` cvs-commit at gcc dot gnu dot org
2004-03-13 18:26 ` [Bug middle-end/14470] [3.4 " pinskia at gcc dot gnu dot org
2004-03-13 18:26 ` cvs-commit at gcc dot gnu dot org
2004-03-13 18:29 ` [Bug middle-end/14470] " pinskia at gcc dot gnu dot org
2004-03-13 18:32 ` cvs-commit at gcc dot gnu dot org
2004-03-13 18:42 ` ebotcazou at gcc dot gnu dot org
2004-03-13 18:52 ` pinskia at gcc dot gnu dot org
2004-03-13 19:01 ` ebotcazou at gcc dot gnu dot org
2004-03-19 15:56 ` rearnsha at gcc dot gnu dot org
2004-03-19 17:04 ` mmitchel at gcc dot gnu dot org
2004-03-19 17:07 ` rearnsha at arm dot com
2004-03-19 17:09 ` richard dot earnshaw at arm dot com
2004-03-19 17:59 ` ebotcazou at gcc dot gnu dot org
2004-03-19 17:59 ` ebotcazou at gcc dot gnu dot org
2004-03-19 23:26 ` ebotcazou at gcc dot gnu dot org
2004-03-20 13:40 ` ebotcazou at gcc dot gnu dot org
2004-03-21 19:26 ` mmitchel at gcc dot gnu dot org
2004-03-22 11:59 ` cvs-commit at gcc dot gnu dot org
2004-03-22 12:09 ` cvs-commit at gcc dot gnu dot org
2004-03-22 16:31 ` ebotcazou at gcc dot gnu dot org
2004-03-22 18:40 ` cvs-commit at gcc dot gnu dot org
2004-05-01  1:38 ` dnovillo at gcc dot gnu dot org
2004-05-03 14:42 ` dnovillo at gcc dot gnu dot org
2004-05-03 15:05 ` bangerth at dealii dot org
2004-05-03 15:09 ` dnovillo at redhat dot com
2004-05-03 15:12 ` reichelt at gcc dot gnu dot org
2004-05-03 15:13 ` reichelt at gcc dot gnu dot org
2004-05-03 15:31 ` bangerth at dealii dot org
2004-05-13 21:52 ` [Bug tree-optimization/14470] " pinskia at gcc dot gnu dot org
2004-09-14 22:58 ` dnovillo at gcc dot gnu dot org
2004-09-17  3:53 ` pinskia at gcc dot gnu dot org
2004-09-18 15:44 ` dnovillo 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).