public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/16348] New: Loop gets executed when it shouldnt
@ 2004-07-03 14:51 anton at samba dot org
  2004-07-03 19:57 ` [Bug c/16348] [3.5 Regression] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: anton at samba dot org @ 2004-07-03 14:51 UTC (permalink / raw)
  To: gcc-bugs

I compiled a 3.5 powerpc64 toolchain from cvs (20040703) and found an issue
when booting a linux kernel compiled with it. Here is a simplified test case:

struct foo {
        long *a;
} bar[0];

#define SIZE (sizeof(bar)/sizeof(*bar))

int main()
{
        int i;

        printf("%d\n", SIZE);
        for (i = 0; i < SIZE; i++)
                printf("can not happen\n");
}

When compiled with no optimisation, the loop is executed even though size is 0:
0
can not happen
can not happen
can not happen
etc.

-- 
           Summary: Loop gets executed when it shouldnt
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anton at samba dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc64-unknown-linux-gnu


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


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

* [Bug c/16348] [3.5 Regression] Loop gets executed when it shouldnt
  2004-07-03 14:51 [Bug c/16348] New: Loop gets executed when it shouldnt anton at samba dot org
@ 2004-07-03 19:57 ` pinskia at gcc dot gnu dot org
  2004-07-04  1:51 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-03 19:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-03 19:57 -------
Confirmed, it is broken in 20040628 also.
Somehow the conditional is being removed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-07-03 19:57:12
               date|                            |
            Summary|Loop gets executed when it  |[3.5 Regression] Loop gets
                   |shouldnt                    |executed when it shouldnt
   Target Milestone|---                         |3.5.0


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


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

* [Bug c/16348] [3.5 Regression] Loop gets executed when it shouldnt
  2004-07-03 14:51 [Bug c/16348] New: Loop gets executed when it shouldnt anton at samba dot org
  2004-07-03 19:57 ` [Bug c/16348] [3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-07-04  1:51 ` pinskia at gcc dot gnu dot org
  2004-07-04 14:31 ` giovannibajo at libero dot it
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-07-04  1:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-07-04 01:51 -------
It worked on 20040623 but not in 20040627.

-- 


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


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

* [Bug c/16348] [3.5 Regression] Loop gets executed when it shouldnt
  2004-07-03 14:51 [Bug c/16348] New: Loop gets executed when it shouldnt anton at samba dot org
  2004-07-03 19:57 ` [Bug c/16348] [3.5 Regression] " pinskia at gcc dot gnu dot org
  2004-07-04  1:51 ` pinskia at gcc dot gnu dot org
@ 2004-07-04 14:31 ` giovannibajo at libero dot it
  2004-07-04 17:29 ` cvs-commit at gcc dot gnu dot org
  2004-07-04 17:32 ` rth at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: giovannibajo at libero dot it @ 2004-07-04 14:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-07-04 14:31 -------
the first generic dump is already borked:

main ()
{
  int i;

  printf ("%d\n", 0);
  i = 0;
  <D1105>:;
  printf ("can not happen\n");
  i = i + 1;
  goto <D1105>;
}

Could be up to the recent RTH work on genericization? It went in in the 
timeframe Pinksi isolated.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org


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


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

* [Bug c/16348] [3.5 Regression] Loop gets executed when it shouldnt
  2004-07-03 14:51 [Bug c/16348] New: Loop gets executed when it shouldnt anton at samba dot org
                   ` (2 preceding siblings ...)
  2004-07-04 14:31 ` giovannibajo at libero dot it
@ 2004-07-04 17:29 ` cvs-commit at gcc dot gnu dot org
  2004-07-04 17:32 ` rth at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-07-04 17:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-07-04 17:29 -------
Subject: Bug 16348

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rth@gcc.gnu.org	2004-07-04 17:28:56

Modified files:
	gcc            : ChangeLog c-typeck.c 
Added files:
	gcc/testsuite/gcc.c-torture/execute: 20040704-1.c 

Log message:
	PR c/16348
	* c-typeck.c (c_finish_loop): Don't clear cond for cond_is_first loops.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4284&r2=2.4285
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-typeck.c.diff?cvsroot=gcc&r1=1.335&r2=1.336
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/20040704-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c/16348] [3.5 Regression] Loop gets executed when it shouldnt
  2004-07-03 14:51 [Bug c/16348] New: Loop gets executed when it shouldnt anton at samba dot org
                   ` (3 preceding siblings ...)
  2004-07-04 17:29 ` cvs-commit at gcc dot gnu dot org
@ 2004-07-04 17:32 ` rth at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-07-04 17:32 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2004-07-04 17:31 -------
Fixed.

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


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


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

end of thread, other threads:[~2004-07-04 17:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-03 14:51 [Bug c/16348] New: Loop gets executed when it shouldnt anton at samba dot org
2004-07-03 19:57 ` [Bug c/16348] [3.5 Regression] " pinskia at gcc dot gnu dot org
2004-07-04  1:51 ` pinskia at gcc dot gnu dot org
2004-07-04 14:31 ` giovannibajo at libero dot it
2004-07-04 17:29 ` cvs-commit at gcc dot gnu dot org
2004-07-04 17:32 ` rth 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).