c-family: Fix error-recovery ICE on __builtin_speculation_safe_value [PR94968]
authorJakub Jelinek <jakub@redhat.com>
Thu, 7 May 2020 12:54:20 +0000 (14:54 +0200)
committerJakub Jelinek <jakub@redhat.com>
Thu, 7 May 2020 12:54:20 +0000 (14:54 +0200)
commit9b95bb52b40c05e630278fe5cd61a79a3c4f620a
tree29849696b5aaca2bd9d1d0f79263c4f4cd62d6ba
parent9cd70f3f0fa45cbe899da5ecd0b0c6da0657fd62
c-family: Fix error-recovery ICE on __builtin_speculation_safe_value [PR94968]

If the second argument of __builtin_speculation_safe_value is
error_mark_node (or has such a type), we ICE during
useless_typ_conversion_p.

202-05-07  Jakub Jelinek  <jakub@redhat.com>

PR c/94968
* c-common.c (speculation_safe_value_resolve_params): Return false if
error_operand_p (val2).
(resolve_overloaded_builtin) <case BUILT_IN_SPECULATION_SAFE_VALUE_N>:
Remove extraneous semicolon.

* gcc.dg/pr94968.c: New test.
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr94968.c [new file with mode: 0644]