Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Upcoming features in GCC 6

February 23, 2016
Jeff Law
Related topics:
Developer Tools
Related products:
Developer Tools

Share:

    The GCC project has traditionally made major releases yearly in the March/April timeframe.  March is rapidly approaching and the GCC project's engineers are busy polishing things up for the GCC 6 release.  I'm going to take a short break from my own release efforts to briefly talk about some of the new features.

    Warnings GCC strives to implement warnings which help developers catch errors at compile time rather than allow potentially dangerous code to be silently accepted and ultimately deployed.   For GCC 6, the major warning additions are:

    Misleading indentation: The goal of the misleading indentation warning is to detect code where the block structure likely does not match how a human would read the code.  The most obvious example is the the "Apple SSL bug" from 2014 where mis-indented code made it look like a GOTO was guarded by a prior IF conditional, when in fact it was not guarded at all.  This will be covered in more detail in a blog post from David Malcolm.

    Tautological comparisons: Code which compares an object to itself and which always evaluates to the same result often represents a typo/bug in the source code.  GCC 6 will now warn for such comparisons.

    Duplicated Condition: GCC 6 will now warn when a condition is repeated in an IF-ELSE-IF chain.

    Negative shift value and shift overflow: GCC now warns when left shifting a negative value or when a left shift overflows.  These have always had undefined behavior and catching them at compile time rather than allowing runtime undefined behaviour is always advisable.

    null-dereference:  GCC is more aggressive about detecting paths that trigger erroneous or undefined behaviour by dereferencing a NULL pointer or using a NULL value in a return or as a function argument when a NULL value for that argument/return value has been explicitly disallowed by the function's attributes.

    Features: Each release of GCC brings a variety of new features designed to make development using GCC easier in some way or another.  Highlights from the upcoming GCC 6 release include:

    OpenMP 4.5:  OpenMP is an API to provide a simple, but highly flexible interface for developing parallel C, C++ and Fortran programs.  The OpenMP 4.5 specification was released in November 2015 and includes many new changes since the prior OpenMP 4.0 specification.  GCC 6 will include support for OpenMP 4.5 for C and C++ and OpenMP 4.0 support for Fortran with some degree of offloading support, particularly for the Intel MIC processor.

    Segment register support:  The x86/x86_64 is a segmented memory architecture, yet GCC has largely ignored this aspect of the Intel architecture and relied on implicit segment registers.  Low level code such as the Linux kernel & glibc often have to be aware of the segmented architecture and have traditionally resorted to asm statements to use explicit segment registers for memory accesses.  Starting with GCC 6, variables may be declared as being relative to a particular segment.  Explicit segment registers will then be used to access those variables in memory.

    Rich locations and other diagnostic work: GCC 6 adds the concept of "rich locations" to its diagnostic machinery.  This allows GCC to track ranges rather than just points for diagnostic messages.  So, for example, the problematical subexpression within a more complex expression can be identified and highlighted to the developer.  Diagnostics can now include "fix-it" hints which can suggest how incorrect code can be fixed.  This will be covered in more depth in a separate blog post from David Malcolm.

    Target Clones:  GCC 6 adds the new "target_clones" attribute which specifies that a particular function should be compiled multiple times for different ISA variants and a runtime dispatcher created to check the in-use ISA and call the appropriate clone.  This makes it much easier to support runtime-specialized routines for different versions of a particular ISA.

    Scalar Storage Order:  GCC 6 adds an new pragma "scalar_storage_order" which can be used to specify the endianness of fields within a structure.  GCC will automatically generate code to byte swap these objects as-needed if the target's endianness differs from the endianness of the objects being accessed.

    Offloading/HSA: GCC 5 had initial support for offloading to MIC via OpenMP and to NVidia GPUs via OpenACC.  GCC 6 improves on those existing capabilities and also adds offloading via HSA accelerators.

    Languages and Runtime Libraries:

    GCC 6 now defaults to C++ 14.  GCC 6 now includes C++ Concepts.

    The C++ runtime library now supports mathematical special functions (ISO/IEC 29124:2010)

    Experimental support for C++17 features

    std::uncaught_exceptions

    try_emplace and insert_or_assign for unique_key maps

    non-member functions std::size, std::empty and std::data for accessing containers and arrays

    std::invoke

    std::shared_mutex

    std::void_t and std::bool_constant

    Experimental support for the File System TS

    Experimental support for most of the second version of the Library Fundamentals TS, including polymorphic memory resources and array support in shared_ptr

    MATMUL intrinsic is now inlined for simple cases in the Fortran front-end

    And, of course more optimizations and bugfixes than you can shake a stick at.  I won't even try to enumerate all that's happened in this space.  As is the case with ever release, we strive to improve the generated code in as many cases as we can and fix as many reported bugs as we can.

     

     

    Recent Posts

    • Introducing Red Hat build of Cryostat 4.0

    • How we improved AI inference on macOS Podman containers

    • How OpenShift Virtualization supports VM live migration

    • How SELinux deny rules improve system security

    • Advanced time manipulation with GDB

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue