public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/9387: jump threading bug
@ 2003-03-22 18:31 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-03-22 18:31 UTC (permalink / raw)
  To: Svein.Seldal, gcc-bugs, gcc-prs, m.hayes, nobody

Synopsis: jump threading bug

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Sat Mar 22 18:31:25 2003
State-Changed-Why:
    Patches have been checked in, so assumed fixed.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9387


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

* optimization/9387: jump threading bug
@ 2003-01-21 14:16 Svein.Seldal
  0 siblings, 0 replies; 2+ messages in thread
From: Svein.Seldal @ 2003-01-21 14:16 UTC (permalink / raw)
  To: gcc-gnats; +Cc: m.hayes


>Number:         9387
>Category:       optimization
>Synopsis:       jump threading bug
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 21 14:16:02 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Svein.Seldal@solidas.com
>Release:        gcc: gcc-3_3-branch checked out 20030118, compiled for target tic4x
>Organization:
>Environment:
Cygwin 1.3.15 with gcc 3.2.1, binutils 2.13.2
>Description:
Compilation of the following code generates invalid code. I compile the code with "tic4x-gcc -O2 -g -c gcc_bug.c -o gcc_bug.o".

The code executes the first "if" block conditionally (which is OK). But the second one is executed regardless of the value of tc.

According to the maintainer, the RTL emit is OK, so this is a bug in the jump threading code. I am not able to provoke this error on i386 host native, nor the AVR target.


CODE:
-----

typedef unsigned int uint;
typedef struct _Task {
    uint Context[33];
    struct _Task *Next;
} Task;
extern Task *CurrentTask;
extern Task *_TaskHead;


Task *_GetNextTask(Task *tc)
{
    if(tc)
    {
        tc = CurrentTask->Next;
    }
    if(!tc)
    {
        tc = _TaskHead;
    }
    return tc;
}
>How-To-Repeat:
tic4x-gcc -O2 -g -c gcc_bug.c -o gcc_bug.o
>Fix:
Either compile the code without the -O2 option or use the -fno-thread-jumps option:

tic4x-gcc -O2 -g -c gcc_bug.c -o gcc_bug.o -fno-thread-jumps
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2003-03-22 18:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-22 18:31 optimization/9387: jump threading bug bangerth
  -- strict thread matches above, loose matches on Subject: below --
2003-01-21 14:16 Svein.Seldal

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