Bug 39722 - [4.8/4.9 Regression][cond-optab] worse code with bitfields on v850, mn10300, avr
Summary: [4.8/4.9 Regression][cond-optab] worse code with bitfields on v850, mn10300, avr
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.5.0
: P4 normal
Target Milestone: 4.8.5
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 39714
  Show dependency treegraph
 
Reported: 2009-04-10 12:50 UTC by Paolo Bonzini
Modified: 2024-06-08 00:36 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Bonzini 2009-04-10 12:50:50 UTC
struct S
{
  unsigned int s;
};
struct T
{
  struct S t[2];
  unsigned int u : 1;
};

void
foo (int x, int y, int z)
{
  int i;
  struct T t;

  t.u = t.u;
  for (i = 0; i < x; i++)
    if (z != 1)
      t.t[i].s = y || t.u;
}
Comment 1 Paolo Bonzini 2009-04-14 08:29:59 UTC
Seems to be caused by a failure to simplify

    (if_then_else (ne (zero_extract:SI (const_int 0 [0x0])
                (const_int 1 [0x1])
                (const_int 0 [0x0]))
            (const_int 0 [0x0]))
        (label_ref 71)
        (pc)))
Comment 2 Paolo Bonzini 2009-07-14 21:17:56 UTC
(This is gcc.c-torture/compile/20071128-1.c).
Comment 3 Richard Biener 2010-04-06 11:19:45 UTC
GCC 4.5.0 is being released.  Deferring to 4.5.1.
Comment 4 Richard Biener 2010-07-31 09:29:20 UTC
GCC 4.5.1 is being released, adjusting target milestone.
Comment 5 Richard Biener 2010-12-16 13:02:56 UTC
GCC 4.5.2 is being released, adjusting target milestone.
Comment 6 Richard Biener 2011-04-28 14:51:13 UTC
GCC 4.5.3 is being released, adjusting target milestone.
Comment 7 Jakub Jelinek 2013-04-12 15:16:40 UTC
GCC 4.6.4 has been released and the branch has been closed.
Comment 8 Richard Biener 2014-06-12 13:45:01 UTC
The 4.7 branch is being closed, moving target milestone to 4.8.4.
Comment 9 Jakub Jelinek 2014-12-19 13:35:08 UTC
GCC 4.8.4 has been released.
Comment 10 Jeffrey A. Law 2015-02-06 19:54:15 UTC
First note the testcase is rather bogus.  Modern compilers collapse foo() down into a simple return as DCE doesn't find any statements within foo() which affect state outside of foo.  Testing was thus done with "t" being an extern.


The code we generate on the trunk for the v850 is marginally better than what we generated prior to the cond-optab merge (smaller by a single move insn)

The code we generate on the mn103 is slightly better as well.  It uses fewer registers (and as a result has less memory traffic to save/restore registers), and generates smaller code.

The avr code looks considerably better, though my familiarity with that architecture is minimal.  It appears to use fewer registers and is considerably smaller.

I haven't done bisection to see what fixed the reported regressions, nor do I plan to.  While this might have been a regression in 4.8 and 4.9, I don't think anyone bothered to check and I can't see anyone bothering to do so in the future or backport the fix if it were identified.


Thus I'm closing as resolved.  If anyone objects, feel free to reopen.