public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/65002] [5 Regression] ICE: Segmentation fault
       [not found] <bug-65002-4@http.gcc.gnu.org/bugzilla/>
@ 2015-02-10 13:52 ` rguenth at gcc dot gnu.org
  2015-02-10 13:55 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-02-10 13:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65002

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-02-10
                 CC|                            |jamborm at gcc dot gnu.org
          Component|c++                         |tree-optimization
   Target Milestone|---                         |5.0
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.

> ./cc1plus  -quiet t.ii -O2
t.ii: In member function 'virtual int B::m_fn1(float) const':
t.ii:22:1: internal compiler error: tree check: expected ssa_name, have
var_decl in walk_aliased_vdefs_1, at tree-ssa-alias.c:2772
 }
 ^
0x12ae851 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        /space/rguenther/src/svn/trunk/gcc/tree.c:9290
0x6d9331 tree_check(tree_node*, char const*, int, char const*, tree_code)
        /space/rguenther/src/svn/trunk/gcc/tree.h:2846
0x10d8eb1 walk_aliased_vdefs_1
        /space/rguenther/src/svn/trunk/gcc/tree-ssa-alias.c:2772
0x10d90bc walk_aliased_vdefs(ao_ref*, tree_node*, bool (*)(ao_ref*, tree_node*,
void*), void*, bitmap_head**, bool*)
        /space/rguenther/src/svn/trunk/gcc/tree-ssa-alias.c:2824
0xd70695 parm_preserved_before_stmt_p
        /space/rguenther/src/svn/trunk/gcc/ipa-prop.c:937
0xd70ab9 ipa_load_from_parm_agg_1
        /space/rguenther/src/svn/trunk/gcc/ipa-prop.c:1072
0xd70dbe ipa_load_from_parm_agg(ipa_node_params*, gimple_statement_base*,
tree_node*, int*, long*, bool*)
        /space/rguenther/src/svn/trunk/gcc/ipa-prop.c:1135
0xd5aa69 unmodified_parm_or_parm_agg_item
        /space/rguenther/src/svn/trunk/gcc/ipa-inline-analysis.c:1617
0xd5c43e will_be_nonconstant_predicate
        /space/rguenther/src/svn/trunk/gcc/ipa-inline-analysis.c:2078
0xd5e529 estimate_function_body_sizes
        /space/rguenther/src/svn/trunk/gcc/ipa-inline-analysis.c:2697
0xd5f6d5 compute_inline_parameters(cgraph_node*, bool)
        /space/rguenther/src/svn/trunk/gcc/ipa-inline-analysis.c:2950
0x10c4cf4 convert_callers_for_node
        /space/rguenther/src/svn/trunk/gcc/tree-sra.c:4922
0xaabf36 cgraph_node::call_for_symbol_thunks_and_aliases(bool (*)(cgraph_node*,
void*), void*, bool, bool)
        /space/rguenther/src/svn/trunk/gcc/cgraph.c:2203
0x10c4d66 convert_callers
        /space/rguenther/src/svn/trunk/gcc/tree-sra.c:4937
0x10c4fc1 modify_function
        /space/rguenther/src/svn/trunk/gcc/tree-sra.c:4993
0x10c55ef ipa_early_sra
        /space/rguenther/src/svn/trunk/gcc/tree-sra.c:5146
0x10c5728 execute
        /space/rguenther/src/svn/trunk/gcc/tree-sra.c:5193
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


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

* [Bug tree-optimization/65002] [5 Regression] ICE: Segmentation fault
       [not found] <bug-65002-4@http.gcc.gnu.org/bugzilla/>
  2015-02-10 13:52 ` [Bug tree-optimization/65002] [5 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
@ 2015-02-10 13:55 ` jakub at gcc dot gnu.org
  2015-02-10 14:03 ` trippels at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-10 13:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65002

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r217125.


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

* [Bug tree-optimization/65002] [5 Regression] ICE: Segmentation fault
       [not found] <bug-65002-4@http.gcc.gnu.org/bugzilla/>
  2015-02-10 13:52 ` [Bug tree-optimization/65002] [5 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
  2015-02-10 13:55 ` jakub at gcc dot gnu.org
@ 2015-02-10 14:03 ` trippels at gcc dot gnu.org
  2015-02-10 15:37 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-02-10 14:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65002

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |trippels at gcc dot gnu.org

--- Comment #3 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Might be a dup a PR64597.


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

* [Bug tree-optimization/65002] [5 Regression] ICE: Segmentation fault
       [not found] <bug-65002-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2015-02-10 14:03 ` trippels at gcc dot gnu.org
@ 2015-02-10 15:37 ` jakub at gcc dot gnu.org
  2015-02-11 11:29 ` enkovich.gnu at gmail dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-10 15:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65002

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Seems estimate_function_body_sizes, in particular the ipa_load_from_parm_agg,
assumes that the function has SSA form properly updated, but since the bounded
pointers stuff changes that is not necessarily true.  Normally that is fixed up
now during fixup_cfg pass, but this call happens before that.
Perhaps we need to update ssa form for the function if it hasn't been updated
yet before we call these?


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

* [Bug tree-optimization/65002] [5 Regression] ICE: Segmentation fault
       [not found] <bug-65002-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2015-02-10 15:37 ` jakub at gcc dot gnu.org
@ 2015-02-11 11:29 ` enkovich.gnu at gmail dot com
  2015-02-11 12:33 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: enkovich.gnu at gmail dot com @ 2015-02-11 11:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65002

--- Comment #6 from Ilya Enkovich <enkovich.gnu at gmail dot com> ---
Is this actually an ICE on valid code?  'const' attribute seems incorrect here
similar to what we had in PR64353.

The problem comes from SSA inconsistency caused by the wrong attribute. 
Probably just ignore such cases in SRA as was previously proposed for PR64353?

Here is a possible patch (SSA update at fixup_cfg start may be removed then):

diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index ad9584e..7f78e68 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -4890,6 +4890,20 @@ some_callers_have_mismatched_arguments_p (struct
cgraph_node *node,
   return false;
 }

+/* Return false if all callers have vuse attached to a call statement.  */
+
+static bool
+some_callers_have_no_vuse_p (struct cgraph_node *node,
+                            void *data ATTRIBUTE_UNUSED)
+{
+  struct cgraph_edge *cs;
+  for (cs = node->callers; cs; cs = cs->next_caller)
+    if (!cs->call_stmt || !gimple_vuse (cs->call_stmt))
+      return true;
+
+  return false;
+}
+
 /* Convert all callers of NODE.  */

 static bool
@@ -5116,6 +5130,15 @@ ipa_early_sra (void)
       goto simple_out;
     }

+  if (node->call_for_symbol_thunks_and_aliases
+       (some_callers_have_no_vuse_p, NULL, true))
+    {
+      if (dump_file)
+       fprintf (dump_file, "There are callers with no VUSE attached "
+                "to a call stmt.\n");
+      goto simple_out;
+    }
+
   bb_dereferences = XCNEWVEC (HOST_WIDE_INT,
                                 func_param_count
                                 * last_basic_block_for_fn (cfun));


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

* [Bug tree-optimization/65002] [5 Regression] ICE: Segmentation fault
       [not found] <bug-65002-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2015-02-11 11:29 ` enkovich.gnu at gmail dot com
@ 2015-02-11 12:33 ` jakub at gcc dot gnu.org
  2015-02-13  9:44 ` ienkovich at gcc dot gnu.org
  2015-02-13 11:15 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-11 12:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65002

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Sure, the __attribute__((const)) looks very much wrong to me, as it returns
what the reference points, it necessarily reads memory and therefore is at most
pure, but certainly not const.

But, we must not ICE even on invalid or questionable code.  And misplaced const
attribute isn't something we should hard error on, perhaps warn (I think there
is some PR about that and it is definitely non-trivial).


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

* [Bug tree-optimization/65002] [5 Regression] ICE: Segmentation fault
       [not found] <bug-65002-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2015-02-11 12:33 ` jakub at gcc dot gnu.org
@ 2015-02-13  9:44 ` ienkovich at gcc dot gnu.org
  2015-02-13 11:15 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: ienkovich at gcc dot gnu.org @ 2015-02-13  9:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65002

--- Comment #8 from ienkovich at gcc dot gnu.org ---
Author: ienkovich
Date: Fri Feb 13 09:44:07 2015
New Revision: 220679

URL: https://gcc.gnu.org/viewcvs?rev=220679&root=gcc&view=rev
Log:
gcc/

    PR tree-optimization/65002
    * tree-cfg.c (pass_data_fixup_cfg): Don't update
    SSA on start.
    * tree-sra.c (some_callers_have_no_vuse_p): New.
    (ipa_early_sra): Reject functions whose callers
    assume function is read only.

gcc/testsuite/

    PR tree-optimization/65002
    * gcc.dg/pr65002.C: New.


Added:
    trunk/gcc/testsuite/gcc.dg/pr65002.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-cfg.c
    trunk/gcc/tree-sra.c


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

* [Bug tree-optimization/65002] [5 Regression] ICE: Segmentation fault
       [not found] <bug-65002-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2015-02-13  9:44 ` ienkovich at gcc dot gnu.org
@ 2015-02-13 11:15 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-02-13 11:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65002

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2015-02-13 11:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-65002-4@http.gcc.gnu.org/bugzilla/>
2015-02-10 13:52 ` [Bug tree-optimization/65002] [5 Regression] ICE: Segmentation fault rguenth at gcc dot gnu.org
2015-02-10 13:55 ` jakub at gcc dot gnu.org
2015-02-10 14:03 ` trippels at gcc dot gnu.org
2015-02-10 15:37 ` jakub at gcc dot gnu.org
2015-02-11 11:29 ` enkovich.gnu at gmail dot com
2015-02-11 12:33 ` jakub at gcc dot gnu.org
2015-02-13  9:44 ` ienkovich at gcc dot gnu.org
2015-02-13 11:15 ` jakub 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).