Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 77a2994748d80edfcc0f8a07e392a23de1eca6a5)
+++ src/SymTab/Validate.cc	(revision 673eb7a23c93903af14453c0bbf51106c4b15ca2)
@@ -960,4 +960,16 @@
 	}
 
+	static bool isNonParameterAttribute( Attribute * attr ) {
+		static const std::vector<std::string> bad_names = {
+			"aligned", "__aligned__",
+		};
+		for ( auto name : bad_names ) {
+			if ( name == attr->name ) {
+				return true;
+			}
+		}
+		return false;
+	}
+
 	Type * ReplaceTypedef::postmutate( TypeInstType * typeInst ) {
 		// instances of typedef types will come here. If it is an instance
@@ -968,11 +980,9 @@
 			ret->location = typeInst->location;
 			ret->get_qualifiers() |= typeInst->get_qualifiers();
-			// attributes are not carried over from typedef to function parameters/return values
-			if ( ! inFunctionType ) {
-				ret->attributes.splice( ret->attributes.end(), typeInst->attributes );
-			} else {
-				deleteAll( ret->attributes );
-				ret->attributes.clear();
-			}
+			// GCC ignores certain attributes if they arrive by typedef, this mimics that.
+			if ( inFunctionType ) {
+				ret->attributes.remove_if( isNonParameterAttribute );
+			}
+			ret->attributes.splice( ret->attributes.end(), typeInst->attributes );
 			// place instance parameters on the typedef'd type
 			if ( ! typeInst->parameters.empty() ) {
