public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/17791] New: [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure
@ 2004-10-02  2:55 pinskia at gcc dot gnu dot org
  2004-10-02  2:55 ` [Bug rtl-optimization/17791] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-02  2:55 UTC (permalink / raw)
  To: gcc-bugs

After fixing PR 17790, I noticed that Ada still does not bootstrap and looked into it and noticed that 
doloop is causing wrong code:
The RTL looks like:
(insn 334 333 429 27 /Volumes/UFS_Partition/pinskia/src/devel/new-fold/gcc/gcc/ada/csets.adb:
1151 (set (reg:SI 118 [ ivtmp.7 ])
        (const_int 255 [0xff])) 332 {*movsi_internal1} (nil)
    (nil))
...
(insn 359 358 360 28 /Volumes/UFS_Partition/pinskia/src/devel/new-fold/gcc/gcc/ada/csets.adb:
1151 (set (reg:SI 278)
        (plus:SI (reg:SI 118 [ ivtmp.7 ])
            (const_int -1 [0xffffffffffffffff]))) -1 (nil)
    (nil))

(insn 360 359 361 28 /Volumes/UFS_Partition/pinskia/src/devel/new-fold/gcc/gcc/ada/csets.adb:
1151 (set (reg:SI 118 [ ivtmp.7 ])
        (zero_extend:SI (subreg:QI (reg:SI 278) 3))) -1 (nil)
    (nil))

(note 361 360 362 28 ("/Volumes/UFS_Partition/pinskia/src/devel/new-fold/gcc/gcc/ada/
csets.adb") 1150)

(insn 362 361 363 28 /Volumes/UFS_Partition/pinskia/src/devel/new-fold/gcc/gcc/ada/csets.adb:
1150 (set (reg:CC 279)
        (compare:CC (reg:SI 118 [ ivtmp.7 ])
            (const_int 0 [0x0]))) -1 (nil)
    (nil))

-- 
           Summary: [4.0 Regression] doloop can produce wrong code causes
                    Ada bootstrap failure
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: wrong-code, build
          Severity: critical
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: powerpc-apple-darwin


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


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

* [Bug rtl-optimization/17791] [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure
  2004-10-02  2:55 [Bug rtl-optimization/17791] New: [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure pinskia at gcc dot gnu dot org
@ 2004-10-02  2:55 ` pinskia at gcc dot gnu dot org
  2004-10-02  2:59 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-02  2:55 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rakdver at gcc dot gnu dot
                   |                            |org
   Target Milestone|---                         |4.0.0


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


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

* [Bug rtl-optimization/17791] [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure
  2004-10-02  2:55 [Bug rtl-optimization/17791] New: [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure pinskia at gcc dot gnu dot org
  2004-10-02  2:55 ` [Bug rtl-optimization/17791] " pinskia at gcc dot gnu dot org
@ 2004-10-02  2:59 ` pinskia at gcc dot gnu dot org
  2004-10-02  3:00 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-02  2:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-02 02:59 -------
I should say that the loop gets turned into a loop which starts at (unsigned)-1 and goes down to 0 
which is wrong.

-- 


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


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

* [Bug rtl-optimization/17791] [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure
  2004-10-02  2:55 [Bug rtl-optimization/17791] New: [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure pinskia at gcc dot gnu dot org
  2004-10-02  2:55 ` [Bug rtl-optimization/17791] " pinskia at gcc dot gnu dot org
  2004-10-02  2:59 ` pinskia at gcc dot gnu dot org
@ 2004-10-02  3:00 ` pinskia at gcc dot gnu dot org
  2004-10-02  5:09 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-02  3:00 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-02 03:00 -------
s/17790/17787.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |17787


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


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

* [Bug rtl-optimization/17791] [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure
  2004-10-02  2:55 [Bug rtl-optimization/17791] New: [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-10-02  3:00 ` pinskia at gcc dot gnu dot org
@ 2004-10-02  5:09 ` pinskia at gcc dot gnu dot org
  2004-10-03 17:47 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-02  5:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-02 05:09 -------
I was able to past the part which I was failing when I reported this bug on powerpc-apple-darwin with 
the patch for PR 17787 and with BOOT_CFLAGS="-O2 -g -fno-branch-count-reg" so I think doloop is 
the last bootstrap problem with Ada.

-- 


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


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

* [Bug rtl-optimization/17791] [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure
  2004-10-02  2:55 [Bug rtl-optimization/17791] New: [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-10-02  5:09 ` pinskia at gcc dot gnu dot org
@ 2004-10-03 17:47 ` pinskia at gcc dot gnu dot org
  2004-10-03 21:44 ` rakdver at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-03 17:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-03 17:47 -------
I hear that this also happens on powerpc-linux and using -fno-branch-count-reg fixes the problem 
there too.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|powerpc-apple-darwin        |powerpc-*-*


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


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

* [Bug rtl-optimization/17791] [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure
  2004-10-02  2:55 [Bug rtl-optimization/17791] New: [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-10-03 17:47 ` pinskia at gcc dot gnu dot org
@ 2004-10-03 21:44 ` rakdver at gcc dot gnu dot org
  2004-10-04  6:56 ` rakdver at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2004-10-03 21:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rakdver at gcc dot gnu dot org  2004-10-03 21:44 -------
Doloop tries to interpret number of iterations that is computed in QImode
in SImode, which causes problems since # of iterations is constant, does not
contain information about its mode and gets missinterpreted.

I am testing the patch.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rakdver at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED


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


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

* [Bug rtl-optimization/17791] [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure
  2004-10-02  2:55 [Bug rtl-optimization/17791] New: [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-10-03 21:44 ` rakdver at gcc dot gnu dot org
@ 2004-10-04  6:56 ` rakdver at gcc dot gnu dot org
  2004-10-06 22:13 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2004-10-04  6:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rakdver at gcc dot gnu dot org  2004-10-04 06:56 -------
Patch:

http://gcc.gnu.org/ml/gcc-patches/2004-10/msg00228.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


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

* [Bug rtl-optimization/17791] [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure
  2004-10-02  2:55 [Bug rtl-optimization/17791] New: [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure pinskia at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2004-10-04  6:56 ` rakdver at gcc dot gnu dot org
@ 2004-10-06 22:13 ` pinskia at gcc dot gnu dot org
  2004-10-07  6:20 ` cvs-commit at gcc dot gnu dot org
  2004-10-07  6:21 ` rakdver at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-06 22:13 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 17791 depends on bug 17787, which changed state.

Bug 17787 Summary: [4.0 Regression] Ada does not bootstrap on darwin because of -feliminate-unused-debug-symbols
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17787

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

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


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

* [Bug rtl-optimization/17791] [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure
  2004-10-02  2:55 [Bug rtl-optimization/17791] New: [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure pinskia at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2004-10-06 22:13 ` pinskia at gcc dot gnu dot org
@ 2004-10-07  6:20 ` cvs-commit at gcc dot gnu dot org
  2004-10-07  6:21 ` rakdver at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-07  6:20 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-10-07 06:20 -------
Subject: Bug 17791

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	rakdver@gcc.gnu.org	2004-10-07 06:20:35

Modified files:
	gcc            : ChangeLog loop-doloop.c loop-iv.c rtl.h 

Log message:
	PR rtl-optimization/17791
	* loop-doloop.c (doloop_modify): Take number of iterations as
	argument.
	(doloop_optimize): Extend or shorten the number of iterations
	when changing mode of counter register.
	* loop-iv.c (lowpart_subreg): Export.
	* rtl.h (lowpart_subreg): Declare.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5778&r2=2.5779
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/loop-doloop.c.diff?cvsroot=gcc&r1=2.9&r2=2.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/loop-iv.c.diff?cvsroot=gcc&r1=2.20&r2=2.21
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/rtl.h.diff?cvsroot=gcc&r1=1.512&r2=1.513



-- 


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


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

* [Bug rtl-optimization/17791] [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure
  2004-10-02  2:55 [Bug rtl-optimization/17791] New: [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure pinskia at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2004-10-07  6:20 ` cvs-commit at gcc dot gnu dot org
@ 2004-10-07  6:21 ` rakdver at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: rakdver at gcc dot gnu dot org @ 2004-10-07  6:21 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rakdver at gcc dot gnu dot org  2004-10-07 06:21 -------
Fixed.

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


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


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

end of thread, other threads:[~2004-10-07  6:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-02  2:55 [Bug rtl-optimization/17791] New: [4.0 Regression] doloop can produce wrong code causes Ada bootstrap failure pinskia at gcc dot gnu dot org
2004-10-02  2:55 ` [Bug rtl-optimization/17791] " pinskia at gcc dot gnu dot org
2004-10-02  2:59 ` pinskia at gcc dot gnu dot org
2004-10-02  3:00 ` pinskia at gcc dot gnu dot org
2004-10-02  5:09 ` pinskia at gcc dot gnu dot org
2004-10-03 17:47 ` pinskia at gcc dot gnu dot org
2004-10-03 21:44 ` rakdver at gcc dot gnu dot org
2004-10-04  6:56 ` rakdver at gcc dot gnu dot org
2004-10-06 22:13 ` pinskia at gcc dot gnu dot org
2004-10-07  6:20 ` cvs-commit at gcc dot gnu dot org
2004-10-07  6:21 ` rakdver 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).