https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90577

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #3)
> Has the code
> 
> /* Left and right shift C routines, to compare to Fortran results.  */
> int c_lshift_ (int *x, int *y) { return (*x) << (*y); }
> int c_rshift_ (int *x, int *y) { return (*x) >> (*y); }
> 
> a defined behavior for y<0?


No.
6.5.7 Bitwise shift operators

1 shift-expression: additive-expression
  shift-expression << additive-expression 
  shift-expression >> additive-expression

Constraints
2 Each of the operands shall have integer type.
Semantics
3 The integer promotions are performed on each of the operands. The type of the
result is that of the promoted left operand. If the value of the right operand
is negative or is greater than or equal to the width of the promoted left
operand, the behavior is undefined.

Reply via email to