public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/23567] New: [3.4/4.0 regression] if-conversion causes wrong code
@ 2005-08-25 21:44 belyshev at depni dot sinp dot msu dot ru
  2005-08-25 22:12 ` [Bug rtl-optimization/23567] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: belyshev at depni dot sinp dot msu dot ru @ 2005-08-25 21:44 UTC (permalink / raw)
  To: gcc-bugs

This patch:

2003-11-02  Roger Sayle  <roger@eyesopen.com>

	PR optimization/10817
	* ifcvt.c (noce_emit_move_insn): Improve documentation comment.
	(noce_try_move): New function to optimize an if-the-else into an
	unconditional move, i.e. "if (a!=b) x=a; else x=b" into "x=a".
	(noce_process_if_block): Attempt simplification with noce_try_move.

causes wrong codegen for this testcase, (taken from debian bug #325050, see
bugs.debian.org/cgi-bin/bugreport.cgi?bug=325050 )

-----------------------------
struct
{
  int len;
  char *name;
} s;

int main (void)
{
  s.len = 0;
  s.name = "";
  if (s.name [s.len] != 0)
    s.name [s.len] = 0;
  return 0;
}
-----------------------------

This looks very similar to PR 13400.

-- 
           Summary: [3.4/4.0 regression] if-conversion causes wrong code
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: belyshev at depni dot sinp dot msu dot ru
                CC: gcc-bugs at gcc dot gnu dot org,sayle at gcc dot gnu dot
                    org


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


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

* [Bug rtl-optimization/23567] [3.4/4.0 regression] if-conversion causes wrong code
  2005-08-25 21:44 [Bug rtl-optimization/23567] New: [3.4/4.0 regression] if-conversion causes wrong code belyshev at depni dot sinp dot msu dot ru
@ 2005-08-25 22:12 ` pinskia at gcc dot gnu dot org
  2005-08-25 23:23 ` [Bug rtl-optimization/23567] [3.4/4.0/4.1 " 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 @ 2005-08-25 22:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-25 21:48 -------
I want to say this was fixed on the mainline by:
2005-05-18  Richard Henderson  <rth@redhat.com>

        PR 21541
        * ifcvt.c (noce_process_if_block): Avoid conversion when the
        memory destination is readonly.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.2


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


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

* [Bug rtl-optimization/23567] [3.4/4.0/4.1 regression] if-conversion causes wrong code
  2005-08-25 21:44 [Bug rtl-optimization/23567] New: [3.4/4.0 regression] if-conversion causes wrong code belyshev at depni dot sinp dot msu dot ru
  2005-08-25 22:12 ` [Bug rtl-optimization/23567] " pinskia at gcc dot gnu dot org
@ 2005-08-25 23:23 ` pinskia at gcc dot gnu dot org
  2005-08-29  9:44 ` debian-gcc at lists dot debian dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-08-25 23:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-08-25 23:21 -------
This is also latent on the mainline too so I was wrong in saying RTH's patch fixed it.
Use -O1 -fno-tree-dominator-opts to reproduce it there.

Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|                            |3.4.0 4.0.0 4.1.0
      Known to work|                            |3.3.3
   Last reconfirmed|0000-00-00 00:00:00         |2005-08-25 23:21:40
               date|                            |
            Summary|[3.4/4.0 regression] if-    |[3.4/4.0/4.1 regression] if-
                   |conversion causes wrong code|conversion causes wrong code


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


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

* [Bug rtl-optimization/23567] [3.4/4.0/4.1 regression] if-conversion causes wrong code
  2005-08-25 21:44 [Bug rtl-optimization/23567] New: [3.4/4.0 regression] if-conversion causes wrong code belyshev at depni dot sinp dot msu dot ru
  2005-08-25 22:12 ` [Bug rtl-optimization/23567] " pinskia at gcc dot gnu dot org
  2005-08-25 23:23 ` [Bug rtl-optimization/23567] [3.4/4.0/4.1 " pinskia at gcc dot gnu dot org
@ 2005-08-29  9:44 ` debian-gcc at lists dot debian dot org
  2005-08-29 17:40 ` jakub at gcc dot gnu dot org
  2005-09-27 16:15 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: debian-gcc at lists dot debian dot org @ 2005-08-29  9:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From debian-gcc at lists dot debian dot org  2005-08-29 09:37 -------
reported as http://bugs.debian.org/325050

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |debian-gcc at lists dot
                   |                            |debian dot org


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


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

* [Bug rtl-optimization/23567] [3.4/4.0/4.1 regression] if-conversion causes wrong code
  2005-08-25 21:44 [Bug rtl-optimization/23567] New: [3.4/4.0 regression] if-conversion causes wrong code belyshev at depni dot sinp dot msu dot ru
                   ` (2 preceding siblings ...)
  2005-08-29  9:44 ` debian-gcc at lists dot debian dot org
@ 2005-08-29 17:40 ` jakub at gcc dot gnu dot org
  2005-09-27 16:15 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-08-29 17:40 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2005-08-25 23:21:40         |2005-08-29 17:15:43
               date|                            |


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


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

* [Bug rtl-optimization/23567] [3.4/4.0/4.1 regression] if-conversion causes wrong code
  2005-08-25 21:44 [Bug rtl-optimization/23567] New: [3.4/4.0 regression] if-conversion causes wrong code belyshev at depni dot sinp dot msu dot ru
                   ` (3 preceding siblings ...)
  2005-08-29 17:40 ` jakub at gcc dot gnu dot org
@ 2005-09-27 16:15 ` mmitchel at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:15 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.2                       |4.0.3


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


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

end of thread, other threads:[~2005-09-27 16:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-25 21:44 [Bug rtl-optimization/23567] New: [3.4/4.0 regression] if-conversion causes wrong code belyshev at depni dot sinp dot msu dot ru
2005-08-25 22:12 ` [Bug rtl-optimization/23567] " pinskia at gcc dot gnu dot org
2005-08-25 23:23 ` [Bug rtl-optimization/23567] [3.4/4.0/4.1 " pinskia at gcc dot gnu dot org
2005-08-29  9:44 ` debian-gcc at lists dot debian dot org
2005-08-29 17:40 ` jakub at gcc dot gnu dot org
2005-09-27 16:15 ` mmitchel 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).