This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 152367 - review Sun Studio compiler options
Summary: review Sun Studio compiler options
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Thomas Preisler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-04 21:37 UTC by Thomas Preisler
Modified: 2009-11-03 18:53 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Preisler 2008-11-04 21:37:39 UTC
Current compiler personality settings are:

C:
        <development_mode>
            <fast_build flags=""/>
            <debug flags="-g" default="true"/>
            <performance_debug flags="-g -xO3 -xhwcprof"/>
            <test_coverage flags="-xprofile=tcov -xinline="/>
            <diagnosable_release flags="-g -xO2"/>
            <release flags="-fast"/>
            <performance_release flags="-xO5 -xipo=1 -xdepend -fsimple=1 -xlibmil -xlibmopt -xvector -xbuiltin"/>
        </development_mode>

C++:
        <development_mode>
            <fast_build flags=""/>
            <debug flags="-g" default="true"/>
            <performance_debug flags="-g0 -xO3 -xhwcprof"/>
            <test_coverage flags="-xprofile=tcov +d -xinline="/>
            <diagnosable_release flags="-g0 -xO2"/>
            <release flags="-fast"/>
            <performance_release flags="-xO5 -xipo=1 -xdepend -fsimple=1 -xlibmil -xlibmopt -xvector -xbuiltin -sync_stdio=no"/>
        </development_mode>

Fortran:
        <development_mode>
            <fast_build flags=""/>
            <debug flags="-g" default="true"/>
            <performance_debug flags="-g -O"/>
            <test_coverage flags="-g"/>
            <diagnosable_release flags="-g -O2"/>
            <release flags="-fast"/>
            <performance_release flags="-O4"/>
        </development_mode>

Review these settings with each compiler team and make the necessary changes.
Comment 1 dnikitin 2008-11-25 12:25:56 UTC
Product Version: NetBeans IDE Dev (Build 200811250201)

I found that in current version (25 Nov) some settings are not equal the expected values.

For example, 
 C++ Compiler Performance Debug 
expected: "-g0 -xO3 -xhwcprof" | real: "-g -xO3 -xhwcprof"

 C++ Compiler Test Coverage
expected: "-xprofile=tcov +d -xinline=" | real: "-xprofile=tcov -xinline="

 C++ Compiler Performance Release
expected: "-xO5 -xipo=1 -xdepend -fsimple=1 -xlibmil -xlibmopt -xvector -xbuiltin -sync_stdio=no" | real: "-xO5 -xipo=1
-xdepend -fsimple=1 -xlibmil -xlibmopt -xvector -xbuiltin"

 Fortran Compiler Test Coverage
expected: "-g" | real: "-g -g"
Comment 2 Thomas Preisler 2009-02-11 16:44:22 UTC
Downgrading to P3. Not really  a P2.
Comment 3 Leonid Lenyashin 2009-10-22 12:30:05 UTC
We need to fix it in 6.8.

One comment: as Performance Release I'd recommend to use -fast instead of the big set of options. It will work much
better. Now it is used for Release which I'd recommend to use just -O.
Comment 4 Thomas Preisler 2009-10-22 16:21:24 UTC
The tools dialog doesn't belong to projects. Code is in core and works independently on projects. In general toolchain
issues are not project issues.
Comment 5 soldatov 2009-10-23 09:29:35 UTC
SunStudio toolchain confuses me. For example on OpenSolaris IDE adds 2 different toolchains SunStudio12.1 and SunStudio
(it is default toolchain). When I set "64 bits" architecture in Project Properties window and build project, then
"-xarch=generic64 is depricated, use -m64" warning appears in console. Of course I haven't this warning if SunStudio12.1
toolchain is selected and IDE generates correct executable files in both cases.
Comment 6 Leonid Lenyashin 2009-10-23 09:42:43 UTC
Absolutely. This has been already reported. -m32 and -m64 are used since SS12. This is important to fix for SS.
upgrading to P2.
Comment 7 Thomas Preisler 2009-10-28 21:56:36 UTC
Suggested changes:
a) swap default 32/64 bit options so SunStudio uses -m32 and -m64 and you will have to specify older compiler to get the
older version -xarch

b) add OpenMP support to Fortran

c) revised options for SS compilers. Proposal:

1) -xhwcprof is sparc only so I removed it (also for sparc). I think it is a NOP on intel though.
2) changed performance_debug to use O2 and diagnosable_release to use O3 (don't understand it was opposite before,
probably a typo)
3) I don't think any release mode should have -g added. People usually don't like that in their releases.
4) Changed -xipo=1 to -xipo
5) Added -xipo to release for C and C++
6) If we decide to have different tables for sparc and intel, we should add -xarch=sse2 -xvector=simd to
performance_release for intel. And -xhwcprof back for sparc?



C:
       <development_mode>
           <debug flags="-g" default="true"/>
           <performance_debug flags="-g -xO2"/>
           <diagnosable_release flags="-g -xO3"/>
           <release flags="-fast -xipo"/>
           <performance_release flags="-xO5 -xipo -xdepend -fsimple=1 -xlibmil -xlibmopt -xvector -xbuiltin"/>
       </development_mode>
C++:
       <development_mode>
           <debug flags="-g" default="true"/>
           <performance_debug flags="-g0 -xO2"/>
           <diagnosable_release flags="-g0 -xO3"/>
           <release flags="-fast -xipo"/>
           <performance_release flags="-xO5 -xipo -xdepend -fsimple=1 -xlibmil -xlibmopt -xvector -xbuiltin
-sync_stdio=no"/>
       </development_mode>
Fortran:
       <development_mode>
           <debug flags="-g" default="true"/>
           <performance_debug flags="-g -O"/>
           <diagnosable_release flags="-g -O2"/>
           <release flags="-fast"/>
           <performance_release flags="-O4"/>
       </development_mode> 
Comment 8 Thomas Preisler 2009-10-29 22:53:31 UTC
Fixed.
Comment 9 Quality Engineering 2009-10-30 11:00:26 UTC
Integrated into 'main-golden', will be available in build *200910300201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/80380a67d37f
User: Thomas Preisler <thp@netbeans.org>
Log: #152367 review Sun Studio compiler options
Comment 10 Leonid Lenyashin 2009-10-30 12:11:15 UTC
Thomas,

I think we need to add -g to all sets as Darryl suggested.
I'd also ask you to think on making the difference for SPARC and x86, because *a lot* of performance on x86 comes from
-xarch=sse2 -xvector=simd (talk to Stanislav Mekhanoshin or Dave Seberger) which is not applicable to SPARC. You may
want to address this in next release, but if so, then file a separate bug please.

I'm also not happy with:
- using -xO3, not -O
- not using -fast in performance release (it omits -xtarget setting, and through that makes all the other flags hardly
useful), in fact your performance release is "slower" than release. 

LL
Comment 11 Thomas Preisler 2009-10-30 21:51:18 UTC
OK, made the following changes:

1) -xO3 => -O
2) using -fast in performance release for all platforms/architectures

Still to be decided:
a) if we want to split options up in a sparc and intel version, we should add -xvector=simd to intel version
b) whether we should add -g to all modes?

I leaning towards yes for a) and no for b) and instead of b), replace "Test Coverage" with "Performance Profiling" with justthe right flags for profiling 
optimized code. This is only valid if the options are different than Release modes. Will make a decision next week.
Comment 12 Quality Engineering 2009-11-01 10:50:34 UTC
Integrated into 'main-golden', will be available in build *200910310201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/db04477dfcf9
User: Thomas Preisler <thp@netbeans.org>
Log: #152367 review Sun Studio compiler options
Comment 13 Quality Engineering 2009-11-03 15:03:34 UTC
Integrated into 'main-golden', will be available in build *200911031401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/78d4b8af2e70
User: Thomas Preisler <thp@netbeans.org>
Log: #152367 review Sun Studio compiler options
update
Comment 14 Thomas Preisler 2009-11-03 18:53:31 UTC
Fixed:
C:
        <development_mode>
           <fast_build flags=""/>
           <debug flags="-g" default="true"/>
           <performance_debug flags="-g -xO2"/>
           <test_coverage flags="-xprofile=tcov -xinline="/>
           <diagnosable_release flags="-g -O"/>
           <release flags="-fast -g"/>
           <performance_release flags="-fast -xipo -g"/>
        </development_mode>

C++:
        <development_mode>
           <fast_build flags=""/>
           <debug flags="-g" default="true"/>
           <performance_debug flags="-g0 -xO2"/>
           <test_coverage flags="-xprofile=tcov +d -xinline="/>
           <diagnosable_release flags="-g0 -O"/>
           <release flags="-fast -g0"/>
           <performance_release flags="-fast -xipo -g0"/>
        </development_mode>
Fortran:
        <development_mode>
           <fast_build flags=""/>
           <debug flags="-g" default="true"/>
           <performance_debug flags="-g -O2"/>
           <test_coverage flags="-g"/>
           <diagnosable_release flags="-g -O"/>
           <release flags="-fast -g"/>
           <performance_release flags="-fast -g"/>
        </development_mode>

Also -xvector=simd is added to Performance Release for x86 platforms for SS12.2, SS12.1, and ExpressAten