Commit dad16761 by Richard Biener Committed by Richard Biener

re PR middle-end/60729 (Compiler failure for combination of -ftrapv and -O3:…

re PR middle-end/60729 (Compiler failure for combination of -ftrapv and -O3: compiler error: in prepare_cmp_insn)

2014-04-02  Richard Biener  <rguenther@suse.de>

	PR middle-end/60729
	* optabs.c (expand_abs_nojump): Honor flag_trapv only for
	MODE_INTs.  Properly use negv_optab.
	(expand_abs): Likewise.

	* g++.dg/vect/pr60729.cc: New testcase.

From-SVN: r209012
parent 21b624f0
2014-04-02 Richard Biener <rguenther@suse.de>
PR middle-end/60729
* optabs.c (expand_abs_nojump): Honor flag_trapv only for
MODE_INTs. Properly use negv_optab.
(expand_abs): Likewise.
2014-04-02 Richard Biener <rguenther@suse.de>
PR bootstrap/60719
* Makefile.in (install-driver): Guard extra installs with special
names properly.
......
......@@ -3384,7 +3384,8 @@ expand_abs_nojump (enum machine_mode mode, rtx op0, rtx target,
{
rtx temp;
if (! flag_trapv)
if (GET_MODE_CLASS (mode) != MODE_INT
|| ! flag_trapv)
result_unsignedp = 1;
/* First try to do it with a special abs instruction. */
......@@ -3407,7 +3408,8 @@ expand_abs_nojump (enum machine_mode mode, rtx op0, rtx target,
{
rtx last = get_last_insn ();
temp = expand_unop (mode, neg_optab, op0, NULL_RTX, 0);
temp = expand_unop (mode, result_unsignedp ? neg_optab : negv_optab,
op0, NULL_RTX, 0);
if (temp != 0)
temp = expand_binop (mode, smax_optab, op0, temp, target, 0,
OPTAB_WIDEN);
......@@ -3449,7 +3451,8 @@ expand_abs (enum machine_mode mode, rtx op0, rtx target,
{
rtx temp, op1;
if (! flag_trapv)
if (GET_MODE_CLASS (mode) != MODE_INT
|| ! flag_trapv)
result_unsignedp = 1;
temp = expand_abs_nojump (mode, op0, target, result_unsignedp);
......
2014-04-02 Richard Biener <rguenther@suse.de>
PR middle-end/60729
* g++.dg/vect/pr60729.cc: New testcase.
2014-04-01 Fabien Chêne <fabien@gcc.gnu.org>
* g++.dg/init/ctor4.C: Adjust.
......
// { dg-do compile }
// { dg-additional-options "-ftrapv" }
void doSomething(int dim, double *Y, double *A)
{
for (int k=0; k<dim; k++)
Y[k] += __builtin_fabs (A[k]);
}
// { dg-final { cleanup-tree-dump "vect" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment