[Bug c/89946] [8/9 Regression] ICE in assemble_start_function, at varasm.c:1871

2019-04-03 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89946

Martin Sebor  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-04-03
 CC||msebor at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Martin Sebor  ---
Confirmed.  The ICE first appeared in r250521 when the attribute was added. 
The handler for the attributes does no validation:

  static tree
  handle_patchable_function_entry_attribute (tree *, tree, tree, int, bool *)
  {
/* Nothing to be done here.  */
return NULL_TREE;
  }

With struct attribute_spec extended to describe basic properties of attribute
arguments besides just their number, basic attribute argument validation could
be done in decl_attributes, similarly to how mutually exclusive attributes are
handled.

[Bug c/89946] [8/9 Regression] ICE in assemble_start_function, at varasm.c:1871

2019-04-05 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89946

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Target Milestone|--- |8.4

[Bug c/89946] [8/9 Regression] ICE in assemble_start_function, at varasm.c:1871

2019-04-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89946

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
 CC||jakub at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org

[Bug c/89946] [8/9 Regression] ICE in assemble_start_function, at varasm.c:1871

2019-04-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89946

--- Comment #2 from Jakub Jelinek  ---
Created attachment 46144
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=46144&action=edit
gcc9-pr89946.patch

Untested fix.

[Bug c/89946] [8/9 Regression] ICE in assemble_start_function, at varasm.c:1871

2019-04-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89946

--- Comment #3 from Jakub Jelinek  ---
Author: jakub
Date: Fri Apr 12 07:28:35 2019
New Revision: 270305

URL: https://gcc.gnu.org/viewcvs?rev=270305&root=gcc&view=rev
Log:
PR c/89946
* varasm.c (assemble_start_function): Don't use tree_fits_uhwi_p
and gcc_unreachable if it fails, just call tree_to_uhwi which
verifies that too.  Test TREE_CHAIN instead of list_length > 1.
Start warning message with a lower-case letter.  Formatting fixes.
c-family/
* c-attribs.c (handle_patchable_function_entry_attribute): Add
function comment.  Warn if arguments of the attribute are not positive
integer constants.
testsuite/
* c-c++-common/pr89946.c: New test.

Added:
trunk/gcc/testsuite/c-c++-common/pr89946.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-family/ChangeLog
trunk/gcc/c-family/c-attribs.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/varasm.c