public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/52314] New: gimplifier produces volatile
@ 2012-02-20  4:38 pinskia at gcc dot gnu.org
  2012-02-20  5:38 ` [Bug middle-end/52314] [4.4/4.5/4.6/4.7 Regression] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-20  4:38 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52314
           Summary: gimplifier produces volatile
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pinskia@gcc.gnu.org


Noticed when improving tree-ssa-forwprop and other passes but is reproducible
on the trunk also.
Take:
volatile double bar;

int foo()
{
 double baz = -__builtin_huge_val();
 return baz <= -bar;
}
--- CUT ---
The gimple output is:
foo ()
{
  int D.1591;
  volatile double bar.0;
  volatile double D.1593;
  double baz;

  baz =  -Inf;
  bar.0 = bar;
  D.1593 = -bar.0;
  D.1591 = D.1593 >= baz;
  return D.1591;
}

--- CUT ---
The variables marked with volatile are wrongly marked as volatile.  Even though
those two decls are not marked with volatile, their types are.  When fold
happens, it sometimes wraps SAVE_EXPR around them because the whole volatile on
the type issue.


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

* [Bug middle-end/52314] [4.4/4.5/4.6/4.7 Regression] gimplifier produces volatile
  2012-02-20  4:38 [Bug middle-end/52314] New: gimplifier produces volatile pinskia at gcc dot gnu.org
@ 2012-02-20  5:38 ` pinskia at gcc dot gnu.org
  2012-02-20 12:12 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-20  5:38 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
      Known to work|                            |4.3.5
           Keywords|                            |wrong-code
   Last reconfirmed|                            |2012-02-20
         AssignedTo|unassigned at gcc dot       |pinskia at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1
            Summary|gimplifier produces         |[4.4/4.5/4.6/4.7
                   |volatile                    |Regression] gimplifier
                   |                            |produces volatile
   Target Milestone|---                         |4.7.0
      Known to fail|                            |4.4.5, 4.7.0

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-20 04:38:21 UTC ---
I am going to fix this.  This was working correctly in 4.3.5


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

* [Bug middle-end/52314] [4.4/4.5/4.6/4.7 Regression] gimplifier produces volatile
  2012-02-20  4:38 [Bug middle-end/52314] New: gimplifier produces volatile pinskia at gcc dot gnu.org
  2012-02-20  5:38 ` [Bug middle-end/52314] [4.4/4.5/4.6/4.7 Regression] " pinskia at gcc dot gnu.org
@ 2012-02-20 12:12 ` rguenth at gcc dot gnu.org
  2012-02-20 19:31 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-20 12:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-20 11:57:38 UTC ---
Once I made create_tmp_var_raw use TYPE_MAIN_VARIANT (type) - but I don't
remember what the fallout from this was.  I suppose at least
create_tmp_from_val
should do that though, at least strip CV qualifiers and address-space
(retaining restrict only?).


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

* [Bug middle-end/52314] [4.4/4.5/4.6/4.7 Regression] gimplifier produces volatile
  2012-02-20  4:38 [Bug middle-end/52314] New: gimplifier produces volatile pinskia at gcc dot gnu.org
  2012-02-20  5:38 ` [Bug middle-end/52314] [4.4/4.5/4.6/4.7 Regression] " pinskia at gcc dot gnu.org
  2012-02-20 12:12 ` rguenth at gcc dot gnu.org
@ 2012-02-20 19:31 ` pinskia at gcc dot gnu.org
  2012-02-21 12:38 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-02-20 19:31 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-20 19:20:04 UTC ---
Actually I have a patch which works around my current issue with fold wrapping
a SAVE_EXPR around a SSA_NAME.  I hope to move away from fold soonish in the
branch I am working on anyways so I will just use that patch until then.


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

* [Bug middle-end/52314] [4.4/4.5/4.6/4.7 Regression] gimplifier produces volatile
  2012-02-20  4:38 [Bug middle-end/52314] New: gimplifier produces volatile pinskia at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-02-20 19:31 ` pinskia at gcc dot gnu.org
@ 2012-02-21 12:38 ` rguenth at gcc dot gnu.org
  2012-02-21 14:14 ` rguenth at gcc dot gnu.org
  2012-02-21 15:16 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-21 12:38 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-21 12:11:42 UTC ---
I am testing

Index: gcc/gimplify.c
===================================================================
--- gcc/gimplify.c      (revision 184428)
+++ gcc/gimplify.c      (working copy)
@@ -504,7 +504,8 @@ create_tmp_reg (tree type, const char *p
 static inline tree
 create_tmp_from_val (tree val)
 {
-  return create_tmp_var (TREE_TYPE (val), get_name (val));
+  /* Drop all qualifiers and address-space information from the value type. 
*/
+  return create_tmp_var (TYPE_MAIN_VARIANT (TREE_TYPE (val)), get_name (val));
 }

 /* Create a temporary to hold the value of VAL.  If IS_FORMAL, try to reuse


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

* [Bug middle-end/52314] [4.4/4.5/4.6/4.7 Regression] gimplifier produces volatile
  2012-02-20  4:38 [Bug middle-end/52314] New: gimplifier produces volatile pinskia at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-02-21 12:38 ` rguenth at gcc dot gnu.org
@ 2012-02-21 14:14 ` rguenth at gcc dot gnu.org
  2012-02-21 15:16 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-21 14:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-21 14:10:43 UTC ---
Author: rguenth
Date: Tue Feb 21 14:10:31 2012
New Revision: 184436

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=184436
Log:
2012-02-21  Richard Guenther  <rguenther@suse.de>

    PR middle-end/52314
    * gimplify.c (create_tmp_from_val): Use the main variant type
    for the type of the temporary we create.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimplify.c


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

* [Bug middle-end/52314] [4.4/4.5/4.6/4.7 Regression] gimplifier produces volatile
  2012-02-20  4:38 [Bug middle-end/52314] New: gimplifier produces volatile pinskia at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-02-21 14:14 ` rguenth at gcc dot gnu.org
@ 2012-02-21 15:16 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-02-21 15:16 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

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

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-21 14:11:22 UTC ---
Fixed for 4.7.


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

end of thread, other threads:[~2012-02-21 14:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-20  4:38 [Bug middle-end/52314] New: gimplifier produces volatile pinskia at gcc dot gnu.org
2012-02-20  5:38 ` [Bug middle-end/52314] [4.4/4.5/4.6/4.7 Regression] " pinskia at gcc dot gnu.org
2012-02-20 12:12 ` rguenth at gcc dot gnu.org
2012-02-20 19:31 ` pinskia at gcc dot gnu.org
2012-02-21 12:38 ` rguenth at gcc dot gnu.org
2012-02-21 14:14 ` rguenth at gcc dot gnu.org
2012-02-21 15:16 ` rguenth at gcc dot gnu.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).