http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58240
--- Comment #13 from shiyan ---
Hi all,
Thank you for all your explanation. This seems more like a philosophical
discussion :)
I do can understand what GCC is doing (as I mentioned, it may be optimized to
*s1-*s2). And I know that this is som
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58240
Jakub Jelinek changed:
What|Removed |Added
CC||jakub at gcc dot gnu.org
--- Comment #12
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58240
--- Comment #11 from Marc Glisse ---
(In reply to shiyan from comment #7)
> Thank you for the suggestion. Yes, I know -fno-builtin can work around it. I
> can think of many possible ways to work around itbut whatever, it is a
> bug.
in your c
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58240
--- Comment #10 from Andrew Pinski ---
(In reply to shiyan from comment #7)
> (In reply to Marc Glisse from comment #4)
> > -fno-builtin (or some better such option)?
> > strncmp is a standard function, your code redefining it has undefined
> > be
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58240
--- Comment #9 from shiyan ---
(In reply to Paolo Carlini from comment #5)
> Closing then.
Hi Carlini,
I still think it is a bug. I know the test case is not practical. In fact, I
will not use such code in real case. But from compiler's side, th
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58240
--- Comment #8 from shiyan ---
(In reply to Jakub Jelinek from comment #6)
> The testcase is clearly bogus. You are not using the result of either of
> the strncmp calls, strncmp is a pure function, so it is fine not to call it
> at all.
Hi Jeli
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58240
--- Comment #7 from shiyan ---
(In reply to Marc Glisse from comment #4)
> -fno-builtin (or some better such option)?
> strncmp is a standard function, your code redefining it has undefined
> behavior. gcc optimizes based on the standard behavior
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58240
--- Comment #6 from Jakub Jelinek ---
The testcase is clearly bogus. You are not using the result of either of the
strncmp calls, strncmp is a pure function, so it is fine not to call it at all.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58240
Paolo Carlini changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58240
--- Comment #4 from Marc Glisse ---
-fno-builtin (or some better such option)?
strncmp is a standard function, your code redefining it has undefined behavior.
gcc optimizes based on the standard behavior of the function.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58240
Paolo Carlini changed:
What|Removed |Added
CC|shiyan2016 at 126 dot com |
--- Comment #3 from Paolo Carlini
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58240
--- Comment #2 from shiyan ---
(In reply to Paolo Carlini from comment #1)
> I can't reproduce this.
Hi,
What is your GCC version? I am using gcc4.7.2. My OS information are as below:
$lsb_release -a
No LSB modules are available.
Distributor ID:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58240
Paolo Carlini changed:
What|Removed |Added
CC|shiyan2016 at 126 dot com |
--- Comment #1 from Paolo Carlini
13 matches
Mail list logo