Compile the attached test case with options -Os, I can get the ideal result:
foo:
cmp r0, #0
ldr r3, .L5
movne r2, #10
moveq r2, #20
str r2, [r3, #0]
bx lr
But when I changed the options to -O2, I got:
foo:
cmp r0,
--- Comment #1 from carrot at google dot com 2009-12-25 08:14 ---
Created an attachment (id=19389)
-- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19389action=view)
test case
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42496
Compile following code with options -march=armv5te -O2
extern void *memcpy(void *dst, const void *src, int n);
void *memmove(void *dst, const void *src, int n)
{
const char *p = src;
char *q = dst;
if (__builtin_expect(q p, 1)) {
return memcpy(dst, src, n);
} else {
Compile following code with options -O2
extern C void foo(long long a, long long b, long long c);
extern C void bar(int a, int b, int c, int d)
{
long long x = (long long)a*b;
long long y = (long long)b*c;
long long z = (long long)c*d;
foo(x,y,z);
}
gcc generates:
bar:
--- Comment #9 from t7 at gmail dot com 2009-12-25 09:18 ---
Most unfortunate the gcc-4.* built with crt and win32api from
http://sf.net/projects/mingw do not suffer from this bug. Therefore specific to
target i686/x86_64-w64-mingw32 http://sourceforge.net/projects/mingw-w64 only.
--- Comment #3 from paolo dot carlini at oracle dot com 2009-12-25 09:47
---
This is not the proper place for academic discussions, definitely. If you are
not convinced, try Comeau, or SunStudio, or ICC in strict mode.
--
paolo dot carlini at oracle dot com changed:
--- Comment #3 from paolo dot carlini at oracle dot com 2009-12-25 09:50
---
Yes, in C++03 (C++0x will be different), a constructor cannot call *another
constructor*.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42472
--- Comment #16 from paolo dot carlini at oracle dot com 2009-12-25 09:53
---
As Jason confirmed, this is not a regression, thus, post 4.5.0.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38392
It seems that GCC 4.2.1 generates better code than GCC 4.4.0 in this case:
The following code (extracted from Android's
Dalvik_java_lang_System_currentTimeMillis in native/java_lang_System.c):
// compilation options: -march=armv5te -mthumb -Os
struct timeval
{
long tv_sec;
long tv_usec;
};
--- Comment #17 from H9XLrv5oXVNvHiUI at spambox dot us 2009-12-25 10:42
---
Ok I managed to compile GCC 4.5, applied the patch and compiled the test code
above and everything works fine. Thanks again!
And yes, I imagined it would have been post 4.5 but I meant 'when' from a time
frame
--- Comment #2 from abel at gcc dot gnu dot org 2009-12-25 10:44 ---
Confirmed. This needs my uncommitted patch from
http://gcc.gnu.org/ml/gcc-patches/2008-09/msg01931.html (which is correctly
saving and restoring can_issue_more variable in the presence of multiple
scheduling points)
--- Comment #18 from paolo dot carlini at oracle dot com 2009-12-25 10:48
---
If I were you, I would not use this kind of C++ at all, for the time being. As
we discussed already, it's *very* weakly supported and your software would not
be portable.
--
--- Comment #19 from H9XLrv5oXVNvHiUI at spambox dot us 2009-12-25 11:02
---
Yeah I know, but consider that I used this code only in a specific circumstance
and does not constitute a core part of my application (or a foundation of some
higher level mechanism). And I know it's a lot
--- Comment #20 from paolo dot carlini at oracle dot com 2009-12-25 11:06
---
Then wait, good luck
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38392
Compile the following code with options -O2
extern C void foo(int a[4]);
extern C void bar(int a, int b, int c, int d)
{
int v[4] = {a,b,c,d};
foo(v);
foo(v);
}
GCC generates
bar:
stmfd sp!, {r4, lr}
.save {r4, lr}
.LCFI0:
.pad #16
sub sp,
Alexvod tried pr31849-patch from
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31849. It changed result size from
72 to 68 below, but still didn't eliminated the loop counter below.
See the following code
// compilation options: -march=armv5te -mthumb -Os
struct tree_block
{
unsigned
The following code
// compilation options: -march=armv5te -mthumb -Os
struct node
{
long long a;
long long b;
};
void func (struct node *n);
long long test (int from, int to)
{
struct node n;
func(n);
if (from == 1)
return n.a;
else
{
if (to == 2)
return n.b;
else
--- Comment #10 from d dot g dot gorbachev at gmail dot com 2009-12-25
13:34 ---
No simple test-case code can be provided you have to read
libxml2 source error.c about less then 1000 lines.
Could you please provide the preprocessed source file, as described here:
Building gcc-4.4-20091215 on arm with java enabled fails with a linkage error:
libtool: link: ( cd .libs rm -f libgcj_bc.la ln -s ../libgcj_bc.la
libgcj_bc.la )
/bin/sh ./libtool --tag=GCJ --mode=link /home/mikpe/objdir44/gcc/gcj
-B/home/mikpe/objdir44/armv5tel-brewer-linux-gnueabi/libjava/
Error occurs when compiling latest linux kernel with 155464 gcc 4.5.0 revision
--
Summary: error: bit-field 'anonymous' width not an integer
constant
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
--- Comment #1 from denis dot onischenko at gmail dot com 2009-12-25 14:52
---
Created an attachment (id=19390)
-- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19390action=view)
preprocessed source file
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42504
--- Comment #2 from denis dot onischenko at gmail dot com 2009-12-25 14:52
---
Created an attachment (id=19391)
-- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19391action=view)
compiler output
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42504
--- Comment #4 from hjl dot tools at gmail dot com 2009-12-25 17:15 ---
*** Bug 42504 has been marked as a duplicate of this bug. ***
--
hjl dot tools at gmail dot com changed:
What|Removed |Added
--- Comment #3 from hjl dot tools at gmail dot com 2009-12-25 17:15 ---
*** This bug has been marked as a duplicate of 42439 ***
--
hjl dot tools at gmail dot com changed:
What|Removed |Added
--- Comment #4 from zsojka at seznam dot cz 2009-12-25 18:42 ---
Created an attachment (id=19392)
-- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19392action=view)
testcase reproducing the crash (with checking enabled)
I wasn't able to reduce number of input files, so they are
This regression was caused by loop canonicalization.
The following example:
struct A {
int f1;
int f2;
};
int func(int c);
int test(struct A* src, struct A* dst, int count)
{
while (count--) {
if (!func(src-f2)) {
return 0;
}
*dst++ = *src++;
}
return 1;
}
gcc
--- Comment #2 from janus at gcc dot gnu dot org 2009-12-25 20:36 ---
Sorry. Of course the code is *not* valid. Section 1.2.2 of the OpenMP 3.0
specification says: The point of exit cannot be a branch out of the structured
block.
Also, an analogous example in C is correctly rejected:
--- Comment #4 from Curatica at gmail dot com 2009-12-25 21:11 ---
Whatever...
--
Curatica at gmail dot com changed:
What|Removed |Added
Status|RESOLVED
--- Comment #5 from Curatica at gmail dot com 2009-12-25 21:12 ---
Whatever...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42470
--- Comment #8 from paolo dot carlini at oracle dot com 2009-12-25 22:11
---
Feedback not forthcoming.
--
paolo dot carlini at oracle dot com changed:
What|Removed |Added
--
paolo dot carlini at oracle dot com changed:
What|Removed |Added
Severity|critical|normal
Known to fail||4.4.2
--- Comment #3 from paolo dot carlini at oracle dot com 2009-12-25 22:17
---
Works in mainline, not a regression, thus closing as fixed.
--
paolo dot carlini at oracle dot com changed:
What|Removed |Added
--- Comment #6 from paolo dot carlini at oracle dot com 2009-12-25 22:21
---
Feedback not forthcoming.
--
paolo dot carlini at oracle dot com changed:
What|Removed |Added
--- Comment #3 from paolo dot carlini at oracle dot com 2009-12-25 22:23
---
Feedback not forthcoming.
--
paolo dot carlini at oracle dot com changed:
What|Removed |Added
--- Comment #3 from paolo dot carlini at oracle dot com 2009-12-25 22:25
---
Feedback not forthcoming.
--
paolo dot carlini at oracle dot com changed:
What|Removed |Added
--- Comment #4 from paolo dot carlini at oracle dot com 2009-12-25 22:26
---
Looks like can be closed.
--
paolo dot carlini at oracle dot com changed:
What|Removed |Added
36 matches
Mail list logo