This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
expr.c longjmp change
- To: egcs at cygnus dot com, egcs-patches at cygnus dot com
- Subject: expr.c longjmp change
- From: John Carr <jfc at mit dot edu>
- Date: Fri, 12 Jun 1998 14:08:16 -0400
The recent change to builtin longjmp causes the compiler to abort when the
C source code supplies a second argument other than 1. The compiler
should not abort on erroneous input. It should report an error.
Fri Jun 12 13:44:48 1998 John Carr <jfc@mit.edu>
* expr.c (expand_builtin, case BUILT_IN_LONGJMP): Error if second
argument not 1.
*** expr.c~ Fri Jun 12 09:41:14 1998
--- expr.c Fri Jun 12 13:42:11 1998
***************
*** 8937,8942 ****
--- 8937,8947 ----
VOIDmode, 0);
rtx value = expand_expr (TREE_VALUE (TREE_CHAIN (arglist)),
NULL_RTX, VOIDmode, 0);
+ if (value != const1_rtx)
+ {
+ error ("__builtin_longjmp second argument must be 1");
+ return const0_rtx;
+ }
expand_builtin_longjmp (buf_addr, value);
return const0_rtx;
}