diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-05-03 00:12:54 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-05-03 00:12:54 +0200 |
commit | fd39794afaedab9f102cede19852ec74e8a1ee17 (patch) | |
tree | 5c5dd6e691732ec9b2037f7d3505aba9100f0aff /gcc | |
parent | 50d94c29c00b00c0e569ec29b56715d8eb1c30af (diff) | |
download | gcc-fd39794afaedab9f102cede19852ec74e8a1ee17.zip gcc-fd39794afaedab9f102cede19852ec74e8a1ee17.tar.gz gcc-fd39794afaedab9f102cede19852ec74e8a1ee17.tar.bz2 |
re PR target/49244 (__sync or __atomic builtins will not emit 'lock bts/btr/btc')
PR target/49244
* gimple.c (gimple_builtin_call_types_compatible_p): Allow
char/short arguments promoted to int because of promote_prototypes.
From-SVN: r235792
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/gimple.c | 11 |
2 files changed, 16 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9515120..028f43a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-05-02 Jakub Jelinek <jakub@redhat.com> + + PR target/49244 + * gimple.c (gimple_builtin_call_types_compatible_p): Allow + char/short arguments promoted to int because of promote_prototypes. + 2016-05-02 Uros Bizjak <ubizjak@gmail.com> * config/i386/predicates.md (register_ssemem_operand): New predicate. diff --git a/gcc/gimple.c b/gcc/gimple.c index b0e19d5..25d965c 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -2486,7 +2486,16 @@ gimple_builtin_call_types_compatible_p (const gimple *stmt, tree fndecl) if (!targs) return true; tree arg = gimple_call_arg (stmt, i); - if (!useless_type_conversion_p (TREE_VALUE (targs), TREE_TYPE (arg))) + tree type = TREE_VALUE (targs); + if (!useless_type_conversion_p (type, TREE_TYPE (arg)) + /* char/short integral arguments are promoted to int + by several frontends if targetm.calls.promote_prototypes + is true. Allow such promotion too. */ + && !(INTEGRAL_TYPE_P (type) + && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node) + && targetm.calls.promote_prototypes (TREE_TYPE (fndecl)) + && useless_type_conversion_p (integer_type_node, + TREE_TYPE (arg)))) return false; targs = TREE_CHAIN (targs); } |