This is the mail archive of the gcc-bugs@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]

[Bug middle-end/82089] emit_cstore sign-extends BImode result for STORE_FLAG_VALUE == 1


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82089

--- Comment #4 from Tom de Vries <vries at gcc dot gnu.org> ---
For gcn at -O0, I ran into the same problem.

As it turns out, the fixed clause is not triggered for -O0, because the clause
is guarded with:
...
  if (GET_MODE_SIZE (target_mode) > GET_MODE_SIZE (result_mode))
...
and target_mode == QImode and results_mode == BImode. Both have mode size 1.

I've fixed this by explicitly handling BImode in the clause, like this:
...
-  if (GET_MODE_SIZE (target_mode) > GET_MODE_SIZE (result_mode))
+  if (GET_MODE_SIZE (target_mode) > GET_MODE_SIZE (result_mode)
+      || (result_mode == BImode && target_mode != BImode))
...

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