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 dom SWITCH_EXPR optimization (PR middle-end/29584)


Hi!

The attached testcase ICEs on x86_64-linux (and other targets) in 4.1,
where DOM forward propagates a void * variable into SWITCH_EXPR's condition
and the middle-end in many places relies on SWITCH_COND having an integral
type (e.g. add_case_node's
  min_value = TYPE_MIN_VALUE (type);
  max_value = TYPE_MAX_VALUE (type);
).  I think it is better to ensure SWITCH_COND has integral type than
changing the middle-end to handle weird types, after all the FEs ensure
that SWITCH_EXPR has been created with integral type.

While this testcase doesn't reproduce the problem on 4.2/4.3, the same
code is still there (though moved to a different function), just loop
optimizer chooses a different type for the IV (in 4.1 it chooses void *
over ulong, in 4.2 it chooses ulong over void *).

Ok for 4.3/4.2/4.1?

	Jakub

Attachment: gcc41-pr29584.patch
Description: Text document

Attachment: gcc42-pr29584.patch
Description: Text document


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