public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/49945] New: [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto
@ 2011-08-02 14:22 rguenth at gcc dot gnu.org
  2011-08-02 14:43 ` [Bug middle-end/49945] " rguenth at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-08-02 14:22 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with
                    -flto
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: lto
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org
                CC: jakub@gcc.gnu.org, jakub@redhat.com,
                    hubicka@gcc.gnu.org, ro@gcc.gnu.org, hp@gcc.gnu.org,
                    hjl.tools@gmail.com, laurent@guerby.net,
                    dimhen@gmail.com
        Depends on: 49373


+++ This bug was initially created as a clone of Bug #49373 +++

On Linux/ia32, revision 174952 gave

FAIL: gcc.dg/guality/vla-1.c  -O2 -flto  line 17 sizeof (a) == 6
FAIL: gcc.dg/guality/vla-1.c  -O2 -flto -flto-partition=none  line 17 sizeof
(a) == 6

Revision 174911 is OK.


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

* [Bug middle-end/49945] [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto
  2011-08-02 14:22 [Bug middle-end/49945] New: [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto rguenth at gcc dot gnu.org
@ 2011-08-02 14:43 ` rguenth at gcc dot gnu.org
  2011-10-10 12:09 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-08-02 14:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.0


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

* [Bug middle-end/49945] [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto
  2011-08-02 14:22 [Bug middle-end/49945] New: [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto rguenth at gcc dot gnu.org
  2011-08-02 14:43 ` [Bug middle-end/49945] " rguenth at gcc dot gnu.org
@ 2011-10-10 12:09 ` rguenth at gcc dot gnu.org
  2011-10-27 10:00 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-10 12:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-10-10
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-10 12:03:43 UTC ---
Confirmed.


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

* [Bug middle-end/49945] [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto
  2011-08-02 14:22 [Bug middle-end/49945] New: [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto rguenth at gcc dot gnu.org
  2011-08-02 14:43 ` [Bug middle-end/49945] " rguenth at gcc dot gnu.org
  2011-10-10 12:09 ` rguenth at gcc dot gnu.org
@ 2011-10-27 10:00 ` rguenth at gcc dot gnu.org
  2011-11-25 10:42 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-10-27 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-10-27 09:57:04 UTC ---
Should be investigated.


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

* [Bug middle-end/49945] [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto
  2011-08-02 14:22 [Bug middle-end/49945] New: [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-10-27 10:00 ` rguenth at gcc dot gnu.org
@ 2011-11-25 10:42 ` jakub at gcc dot gnu.org
  2011-12-01 10:35 ` rguenther at suse dot de
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-11-25 10:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-11-25 09:59:31 UTC ---
This is a bug in lto-streamer-out.c.  TYPE_MAXVAL of the ARRAY_TYPE's
TYPE_DOMAIN e.g. in f1 is a VAR_DECL (DECL_NAME is NULL, DECL_ARTIFICIAL, but
!DECL_IGNORED_P).  It is first encountered in a GIMPLE_DEBUG's first operand,
it hasn't been seen yet, so that VAR_DECL is output.  But, later on
write_global_stream calls lto_output_tree on the VLA ARRAY_TYPE, with ref_p set
to false, and this eventually calls lto_output_tree on that VAR_DECL again.
But this doesn't find it in ob->writer_cache, because the cache has been
destroyed in between, from output_function -> destroy_output_block ->
lto_streamer_cache_delete.
I guess VLA types need to be emitted immediately in the containing function,
rather than being deferred to be written much later on globally.


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

* [Bug middle-end/49945] [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto
  2011-08-02 14:22 [Bug middle-end/49945] New: [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-11-25 10:42 ` jakub at gcc dot gnu.org
@ 2011-12-01 10:35 ` rguenther at suse dot de
  2011-12-07 14:54 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenther at suse dot de @ 2011-12-01 10:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from rguenther at suse dot de <rguenther at suse dot de> 2011-12-01 10:32:45 UTC ---
On Fri, 25 Nov 2011, jakub at gcc dot gnu.org wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49945
> 
> --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-11-25 09:59:31 UTC ---
> This is a bug in lto-streamer-out.c.  TYPE_MAXVAL of the ARRAY_TYPE's
> TYPE_DOMAIN e.g. in f1 is a VAR_DECL (DECL_NAME is NULL, DECL_ARTIFICIAL, but
> !DECL_IGNORED_P).  It is first encountered in a GIMPLE_DEBUG's first operand,
> it hasn't been seen yet, so that VAR_DECL is output.  But, later on
> write_global_stream calls lto_output_tree on the VLA ARRAY_TYPE, with ref_p set
> to false, and this eventually calls lto_output_tree on that VAR_DECL again.
> But this doesn't find it in ob->writer_cache, because the cache has been
> destroyed in between, from output_function -> destroy_output_block ->
> lto_streamer_cache_delete.
> I guess VLA types need to be emitted immediately in the containing function,
> rather than being deferred to be written much later on globally.

Yes, I remember running into this issue as well.  And I have some
patches somewhere that try to do this (but more generally, for all
function-local types IIRC).


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

* [Bug middle-end/49945] [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto
  2011-08-02 14:22 [Bug middle-end/49945] New: [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto rguenth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-12-01 10:35 ` rguenther at suse dot de
@ 2011-12-07 14:54 ` rguenth at gcc dot gnu.org
  2011-12-07 15:01 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-07 14:54 UTC (permalink / raw)
  To: gcc-bugs

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

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 #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-07 14:53:36 UTC ---
Mine.  Similar issue as PR48437.


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

* [Bug middle-end/49945] [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto
  2011-08-02 14:22 [Bug middle-end/49945] New: [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto rguenth at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-12-07 14:54 ` rguenth at gcc dot gnu.org
@ 2011-12-07 15:01 ` rguenth at gcc dot gnu.org
  2011-12-08 11:55 ` rguenth at gcc dot gnu.org
  2011-12-08 12:35 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-07 15:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-07 14:59:52 UTC ---
Index: gcc/lto-streamer-out.c
===================================================================
--- gcc/lto-streamer-out.c      (revision 182081)
+++ gcc/lto-streamer-out.c      (working copy)
@@ -129,6 +129,19 @@ tree_is_indexable (tree t)
   else if (TREE_CODE (t) == VAR_DECL && decl_function_context (t)
           && !TREE_STATIC (t))
     return false;
+  else if (TYPE_P (t)
+          && variably_modified_type_p (t, NULL_TREE))
+    return false;
   else
     return (TYPE_P (t) || DECL_P (t) || TREE_CODE (t) == SSA_NAME);
 }

fixes it.


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

* [Bug middle-end/49945] [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto
  2011-08-02 14:22 [Bug middle-end/49945] New: [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto rguenth at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-12-07 15:01 ` rguenth at gcc dot gnu.org
@ 2011-12-08 11:55 ` rguenth at gcc dot gnu.org
  2011-12-08 12:35 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-08 11:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-08 11:43:16 UTC ---
Author: rguenth
Date: Thu Dec  8 11:43:12 2011
New Revision: 182107

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182107
Log:
2011-12-08  Richard Guenther  <rguenther@suse.de>

    PR lto/49945
    * lto-streamer-out.c (tree_is_indexable): Localize variably
    modified types and their FIELD_DECLs.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lto-streamer-out.c


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

* [Bug middle-end/49945] [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto
  2011-08-02 14:22 [Bug middle-end/49945] New: [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto rguenth at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2011-12-08 11:55 ` rguenth at gcc dot gnu.org
@ 2011-12-08 12:35 ` rguenth at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-12-08 12:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-12-08 12:32:59 UTC ---
Fixed.


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

end of thread, other threads:[~2011-12-08 12:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-02 14:22 [Bug middle-end/49945] New: [4.7 Regression] gcc.dg/guality/vla-1.c FAILs with -flto rguenth at gcc dot gnu.org
2011-08-02 14:43 ` [Bug middle-end/49945] " rguenth at gcc dot gnu.org
2011-10-10 12:09 ` rguenth at gcc dot gnu.org
2011-10-27 10:00 ` rguenth at gcc dot gnu.org
2011-11-25 10:42 ` jakub at gcc dot gnu.org
2011-12-01 10:35 ` rguenther at suse dot de
2011-12-07 14:54 ` rguenth at gcc dot gnu.org
2011-12-07 15:01 ` rguenth at gcc dot gnu.org
2011-12-08 11:55 ` rguenth at gcc dot gnu.org
2011-12-08 12:35 ` 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).