Presentation is loading. Please wait.

Presentation is loading. Please wait.

What's new in GCC 4.7 Jakub Jelínek Presented by Red Hat Czech GCC News.

Similar presentations


Presentation on theme: "What's new in GCC 4.7 Jakub Jelínek Presented by Red Hat Czech GCC News."— Presentation transcript:

1 What's new in GCC 4.7 Jakub Jelínek Presented by Red Hat Czech GCC News

2 GCC 4.7 In stage4 (regression and documentation bugfixes only) mode since mid January Release planned for mid March to end of March 25 th anniversary of GCC this year Release criteria already met

3 Improved C++11 and C11 support Code generation improvements Debug info quality and size improvements Support for new CPUs Transactional memory support OpenMP 3.1 support Fortran 2003 and 2008 improvements Go 1.0 New features

4 -std=c++11, -std=gnu++11 options NSDMI struct S { int i = 4; S () {} }; Template aliases template using P=T*; std::atomic and new atomic builtins for the C++ memory model Delegating constructors struct S { S(int); S() : S(42) {} }; C++11 support improvements

5 User-defined literals operator "" _foo (unsigned long long); unsigned long long x = 1234_foo; Extended friend syntax template class Y { static const int i = 7; public: friend X; }; struct B { int b[Y ::i]; }; Explicit override support __cplusplus macro C++11 support improvements

6 -std=c11, -std=gnu11 options _Noreturn/ _Alignas/_Alignof/max_align_t/ __builtin_complex Partial C11 support

7 IPA – inlining, IPA-CP, IPA-SRA, devirtualization Shrink-wrapping int foo(int x){char b[64]; if(x<0)return-1;bar(b,x);baz(b);...; return b[0];} String length optimizations void foo(char*a,char*b,char*c,char*d) {strcpy(a,b);strcat(a,c);strcat(a,d);} Vectorizer (permutations, pattern recognition, gather) Code generation improvements

8 DW_OP_GNU_entry_value/ DW_TAG_GNU_call_site/ DW_OP_GNU_parameter_ref void foo (int x) { int i=x+6; bar(i); baz();} void test(void) { foo(6); } Typed DWARF stack.debug_macro section 100x size improvement over.debug_macinfo Debug info improvements

9 AVX2 support, including gather FMA, BMI, BMI2, LZCNT, RDRND, FSGSBASE, F16C SPARC VIS support improvements Hardware TM (Intel TSX and HLE) targeted for GCC 4.8 Support for new CPUs

10 So far software only, compiler side + libitm, hybrid support for HW TM will come later __transaction_relaxed { block; } __transaction_atomic { block; } Function attributes transaction_callable transaction_safe, transaction_unsafe transaction_may_cancel_outer __transaction_cancel Transactional memory

11 #pragma omp atomic [read|write|update|capture] min/max C/C++ reductions List OMP_NUM_THREADS env var OMP_PROC_BIND env var #pragma omp taskyield final and mergeable task clauses omp_in_final library routine Some Fortran changes OpenMP 3.1

12 Don't pass garbage options to gcc driver when linking no longer included as implementation detail in STL C++ name lookup fixes Redeclared variables in C++ nested scopes User defined literals vs. literals without whitespace after them #define X "abc" "def"X Porting code to GCC 4.7

13 Identify performance sensitive packages Investigate building them with PGO Build with -fprofile-generate, train on some data, build again with -fprofile-use Investigate non-default compiler options -O3, -Ofast, etc. Some libraries could be built with CPU specific optimizations (-msse2 for i?86, -mavx, etc.), let ld.so pick them up Suggestions for package maintainers

14 For ICEs, rejects-valid, accepts-invalid kind of bugs please provide preprocessed source + compiler options (would be nice if koji could archive them for a while if they show up) For miscompilations please provide if possible small, self-contained testcase Possibility of brute force by doing binary search between -O0/default options compiled objects Don't ignore compiler warnings GCC bug reporting

15 Questions ? jakub@redhat.com Contact:


Download ppt "What's new in GCC 4.7 Jakub Jelínek Presented by Red Hat Czech GCC News."

Similar presentations


Ads by Google