gcc/
* gimplify.cc (gimplify_save_expr): Add missing guard.
gcc/testsuite/
* gnat.dg/shift2.adb: New test.
gcc_assert (TREE_CODE (*expr_p) == SAVE_EXPR);
val = TREE_OPERAND (*expr_p, 0);
- if (TREE_TYPE (val) == error_mark_node)
+ if (val && TREE_TYPE (val) == error_mark_node)
return GS_ERROR;
/* If the SAVE_EXPR has not been resolved, then evaluate it once. */
--- /dev/null
+-- { dg-do compile }
+
+with Interfaces; use Interfaces;
+
+function Shift2 (V : Unsigned_32) return Unsigned_32 is
+begin
+ return Shift_Left (V, (case V is when 0 => 1, when others => 0));
+end;