diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-04-12 09:28:35 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-04-12 09:28:35 +0200 |
commit | 8e8225e69d1173cf0095a59ccf9bad219d016cdd (patch) | |
tree | f7af5b463b314e35498410d956c116c93deeeae3 /gcc/varasm.c | |
parent | c758576accc3eef33c31766352453b0ad1953569 (diff) | |
download | gcc-8e8225e69d1173cf0095a59ccf9bad219d016cdd.zip gcc-8e8225e69d1173cf0095a59ccf9bad219d016cdd.tar.gz gcc-8e8225e69d1173cf0095a59ccf9bad219d016cdd.tar.bz2 |
re PR c/89946 (ICE in assemble_start_function, at varasm.c:1871)
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.
From-SVN: r270305
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index da10ba3..cb43248 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1865,28 +1865,20 @@ assemble_start_function (tree decl, const char *fnname) tree pp_val = TREE_VALUE (patchable_function_entry_attr); tree patchable_function_entry_value1 = TREE_VALUE (pp_val); - if (tree_fits_uhwi_p (patchable_function_entry_value1)) - patch_area_size = tree_to_uhwi (patchable_function_entry_value1); - else - gcc_unreachable (); - + patch_area_size = tree_to_uhwi (patchable_function_entry_value1); patch_area_entry = 0; - if (list_length (pp_val) > 1) + if (TREE_CHAIN (pp_val) != NULL_TREE) { - tree patchable_function_entry_value2 = - TREE_VALUE (TREE_CHAIN (pp_val)); - - if (tree_fits_uhwi_p (patchable_function_entry_value2)) - patch_area_entry = tree_to_uhwi (patchable_function_entry_value2); - else - gcc_unreachable (); + tree patchable_function_entry_value2 + = TREE_VALUE (TREE_CHAIN (pp_val)); + patch_area_entry = tree_to_uhwi (patchable_function_entry_value2); } } if (patch_area_entry > patch_area_size) { if (patch_area_size > 0) - warning (OPT_Wattributes, "Patchable function entry > size"); + warning (OPT_Wattributes, "patchable function entry > size"); patch_area_entry = 0; } @@ -1906,7 +1898,8 @@ assemble_start_function (tree decl, const char *fnname) /* And the area after the label. Record it if we haven't done so yet. */ if (patch_area_size > patch_area_entry) targetm.asm_out.print_patchable_function_entry (asm_out_file, - patch_area_size-patch_area_entry, + patch_area_size + - patch_area_entry, patch_area_entry == 0); if (lookup_attribute ("no_split_stack", DECL_ATTRIBUTES (decl))) |