* going from SunOS 5/SparcWorks -> Linux/gcc
@ 2010-04-29 18:35 Brian Hill
2010-04-29 18:47 ` Steven Bosscher
0 siblings, 1 reply; 4+ messages in thread
From: Brian Hill @ 2010-04-29 18:35 UTC (permalink / raw)
To: gcc
I have an 15-year old C program (which I didn't write) that compiles and
runs fine with SparcWorks cc on Sun SPARC with SunOS 5.10.
It compiles on CentOS 5 64-bit with gcc 4.1.2 but core dumps all over
the place.
Switching to 32-bit compile doesn't help much.
I did as much debugging as I could, but seems to come down to liberal
use of memory that the SparcWorks compiler accommodates that gcc doesn't
by default.
Is there some simple compiler option or other measure I can take to
compile/run the code with gcc?
Rather than get into the details of the code, I figured I start with
this angle.
Thanks!
Brian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: going from SunOS 5/SparcWorks -> Linux/gcc
2010-04-29 18:35 going from SunOS 5/SparcWorks -> Linux/gcc Brian Hill
@ 2010-04-29 18:47 ` Steven Bosscher
2010-04-29 19:06 ` Paweł Sikora
0 siblings, 1 reply; 4+ messages in thread
From: Steven Bosscher @ 2010-04-29 18:47 UTC (permalink / raw)
To: Brian Hill; +Cc: gcc
On Thu, Apr 29, 2010 at 8:25 PM, Brian Hill <bchill@bch.net> wrote:
> I have an 15-year old C program (which I didn't write) that compiles and
> runs fine with SparcWorks cc on Sun SPARC with SunOS 5.10.
>
> It compiles on CentOS 5 64-bit with gcc 4.1.2 but core dumps all over the
> place.
>
> Switching to 32-bit compile doesn't help much.
>
> I did as much debugging as I could, but seems to come down to liberal use of
> memory that the SparcWorks compiler accommodates that gcc doesn't by
> default.
>
> Is there some simple compiler option or other measure I can take to
> compile/run the code with gcc?
>
> Rather than get into the details of the code, I figured I start with this
> angle.
This kind of question really doesn't belong here but on gcc-help. But
while we're here...
The standard 1st questions are:
1) Did you compile with -Wall -Wextra and solve all warnings?
2) Did you try with -fno-strict-aliasing?
There is just not enough information in your question to be more helpful.
Good luck,
Ciao!
Steven
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: going from SunOS 5/SparcWorks -> Linux/gcc
2010-04-29 18:47 ` Steven Bosscher
@ 2010-04-29 19:06 ` Paweł Sikora
2011-04-26 10:22 ` [wwwdocs] PATCH for " Gerald Pfeifer
0 siblings, 1 reply; 4+ messages in thread
From: Paweł Sikora @ 2010-04-29 19:06 UTC (permalink / raw)
To: gcc
On Thursday 29 April 2010 20:35:23 Steven Bosscher wrote:
> The standard 1st questions are:
> 1) Did you compile with -Wall -Wextra and solve all warnings?
> 2) Did you try with -fno-strict-aliasing?
for legacy code, the '-fwrapv' could be helpful.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [wwwdocs] PATCH for Re: going from SunOS 5/SparcWorks -> Linux/gcc
2010-04-29 19:06 ` Paweł Sikora
@ 2011-04-26 10:22 ` Gerald Pfeifer
0 siblings, 0 replies; 4+ messages in thread
From: Gerald Pfeifer @ 2011-04-26 10:22 UTC (permalink / raw)
To: Paweł Sikora, gcc-patches; +Cc: gcc
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1461 bytes --]
Hi PaweÂł,
On Thu, 29 Apr 2010, PaweÂł Sikora wrote:
>> The standard 1st questions are:
>> 1) Did you compile with -Wall -Wextra and solve all warnings?
>> 2) Did you try with -fno-strict-aliasing?
> for legacy code, the '-fwrapv' could be helpful.
your mail reminded me that we could/should clarify this in our bug
reporting instructions.
The patch below, which I just committed, does that.
Thanks for the hint!
Gerald
Index: bugs/index.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/bugs/index.html,v
retrieving revision 1.107
diff -u -r1.107 index.html
--- bugs/index.html 24 Apr 2011 09:51:55 -0000 1.107
+++ bugs/index.html 25 Apr 2011 20:58:56 -0000
@@ -51,10 +51,11 @@
<a href="#known">list of well-known bugs</a> and, <strong>if possible,
try a current release</strong> or development snapshot.</p>
-<p>Before reporting that GCC compiles your code incorrectly, please
-compile it with <code>gcc -Wall -Wextra</code> and see whether this shows
-anything wrong with your code that could be the cause instead of a bug
-in GCC.</p>
+<p>Before reporting that GCC compiles your code incorrectly, compile it
+with <code>gcc -Wall -Wextra</code> and see whether this shows anything
+wrong with your code. Similarly, if compiling with
+<code>-fno-strict-aliasing -fwrapv</code> makes a difference, your code
+probably is not correct.</p>
<h2>Summarized bug reporting instructions</h2>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-26 10:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-29 18:35 going from SunOS 5/SparcWorks -> Linux/gcc Brian Hill
2010-04-29 18:47 ` Steven Bosscher
2010-04-29 19:06 ` Paweł Sikora
2011-04-26 10:22 ` [wwwdocs] PATCH for " Gerald Pfeifer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).