https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89139
--- Comment #6 from Marc Nieper-Wißkirchen ---
Interestingly, the above code, slightly modified, exhibits another problem the
optimizer has:
void foo ();
static void c (void (*w) (void))
{
w ();
}
static void f ()
{
foo ();
}
static v
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89139
--- Comment #5 from Marc Nieper-Wißkirchen ---
Here is a much simpler example, which exhibits the same behavior:
static void c (void (*w) (void))
{
w ();
}
static void f ()
{
}
static void *x = &f;
void g ()
{
c (x);
}
The compiler o
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: m...@nieper-wisskirchen.de
Target Milestone: ---
GCC compiles the function
int foo (unsigned i)
{
return ((i >> 1) & 3) == 2;
}
to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89152
--- Comment #2 from Marc Nieper-Wißkirchen ---
Even if Cont weren't passed in a register, the optimization of the unwrapped,
first version would be missed in the structure-wrapped, second version.
A general solution where such simple wrappers do
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43565
--- Comment #11 from Marc Nieper-Wißkirchen ---
If ISO C allows such linkage to be created outside of the standard, a number of
other assumption would be violated as well:
In 6.2.4 (2) it says that "an object exists, has a constant address, and
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89139
--- Comment #4 from Marc Nieper-Wißkirchen ---
P.S.: This issue showed up when I tried to analyze why no optimization is
happening in bug #89152.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43565
--- Comment #9 from Marc Nieper-Wißkirchen ---
Footnote 29) in section 6.2.2 of the latest draft (N2176) for C18 says: "There
is no linkage between different identifiers."
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: m...@nieper-wisskirchen.de
Target Milestone: ---
GCC compiles the following C module
**
typedef void (*Cont) (void *f, int a);
int quux (int a);
static void g (Cont c, Cont d
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43565
--- Comment #7 from Marc Nieper-Wißkirchen ---
I'm sorry, I wasn't precise what I meant. When I wrote that the optimization
wouldn't be possible I meant the case of two externally defined variables, e.g.
extern int p;
extern int q;
One can forc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43565
--- Comment #5 from Marc Nieper-Wißkirchen ---
If that was possible (that symbols are aliased in the TU in which they are
defined, but not (explicitly) in a TU where they are declared), there would be
the need of a "no_alias" (or "never_alias") a
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: m...@nieper-wisskirchen.de
Target Milestone: ---
The module:
**
extern int p;
extern int q;
int foo (void)
{
return &p == &q;
}
**
is com
erity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: m...@nieper-wisskirchen.de
Target Milestone: ---
Consider the following C module.
**
typedef struct cont
{
void (*f) (struct cont, int a);
} Cont;
12 matches
Mail list logo