This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, middle-end]: Fix g++.dg/other/vector-compare.C testsuite failure on alpha


Hello!

g++.dg/other/vector-compare.C recently started to fail on
alphaev68-pc-linux-gnu with:

[uros@localhost other]$ ~/gcc-build-alpha/gcc/cc1plus -std=gnu++11
-quiet vector-compare.C
vector-compare.C: In function ‘int main()’:
vector-compare.C:26:5: internal compiler error: in
emit_cmp_and_jump_insn_1, at optabs.c:4261
 int main ()
     ^
Please submit a full bug report,
with preprocessed source if appropriate.

Prepare_cmp_insn in optabs.c expands BLKmode compares using either
cmp{mem,str,strn}_optab, or through emit_library_call_value to integer
result register, and follows with the expansion of the compare of the
result with zero. However, the code blindly assumes that the target is
able to compare resulting SImode value, which is not true in case of
alpha. Due to missing SImode compare pattern, the above assert is
triggered in emit_cmp_and_jump_1.

The patch fixes this oversight by simply expanding the comparison of
the result through generic comparison expansion code that conveniently
follows BLKmode compare expansion.

2012-09-18  Uros Bizjak  <ubizjak@gmail.com>

	* optabs.c (prepare_cmp_insn): Expand comparison of the result
	of memory block compare through generic comparison expansion code.

Patch was bootstrapped and regression tested on alphaev68-pc-linux-gnu
and x86_64-pc-linux-gnu {,-m32}.

OK for mainline and release branches?

Thanks,
Uros.

Attachment: p.diff.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]