__attribute__ is the GCC-specific way to attach extra (not defined by the C/C++ standard but useful nevertheless) implementation-defined semantic information to functions, variables and statements, which triggers changes in the behaviour of the code generation. Several other compilers have their own way to attach implementation-defined information, with their own names for the implementation-defined prefix and the implementation-defined attributes, e.g. __declspec with MSC.
For instance, __attribute__((always_inline)) will try extra hard (more than inline / __inline__) to inline a function, and complain if for some reason, it cannot perform said inlining. The opposite is __attribute__((noinline)), which will force GCC to provide an out-of-line function even if it might have wanted to inline the function (e.g. in C, because it's "static", i.e. limited to the current TU, and has a single caller).
There are dozens of other GCC attributes, the most significant of which are supported by compilers which pretend to be GCC (especially Clang, and less so ICC). Some attributes are available across all targets, while some others are platform-specific (e.g. banks of memory which require special instructions, interrupt handlers with special epilogue / prologue, interrupt vectors, etc.).
Note that the C++11 standard defines a generic way to attach attributes to functions / variables / statements (though it defines a ridiculously small number of attributes, IIRC only [[noreturn]] and [[carries_dependency]]), but most of the major C++ compilers do not support it at all, or at least, in a fully spec-compliant way. No released version of GCC supports generalized attributes yet.