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] Fix PR C/35430, C++/35430 ICE with complex int and comparision


Hi,
  The issue here is we call int_fits_type_p with a complex type which
does not make sense.  The way I fixed it is to use the complex's
compent type instead to check to make sure that the int will fit in
the type.

OK? Bootstrapped and tested on i686-linux-gnu with no regressions.

Thanks,
Andrew Pinski

ChangeLog:

* c-typeck.c (build_binary_op): Use the complex component's type
instead of the complex type
when calling int_fits_type_p.

cp/ChangeLog:
* typeck.c (cp_build_binary_op): Use the complex component's type
instead of the complex type
when calling int_fits_type_p.

testsuite/ChangeLog:

* g++.dg/ext/Wextra-complex.C: New testcase
* gcc.dg/Wextra-complex.c: New testcase.

Attachment: fixprWextracmpvectorint.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]