diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c245470e447b259c4340f7d50eac5102abcc5ecf..7ea63ecce82feec1f2655bf8bef667a1788fece6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -28,6 +28,10 @@
 	(arm_block_move_unaligned_straight): Likewise.
 	(arm_adjust_block_mem): Likewise.
 
+	PR target/54662
+	* config/mep/t-mep (mep-pragma.o): Use ALL_COMPILERFLAGS instead of
+	ALL_CFLAGS.
+
 2013-02-26  Marek Polacek  <polacek@redhat.com>
 
 	PR tree-optimization/56426
diff --git a/gcc/config/mep/t-mep b/gcc/config/mep/t-mep
index 7e0321c98c7839c0c614a993ce626ac91e82c1ba..b877b950dea31b13023de87e621f906940d66c0f 100644
--- a/gcc/config/mep/t-mep
+++ b/gcc/config/mep/t-mep
@@ -29,7 +29,7 @@ mep-pragma.o: $(srcdir)/config/mep/mep-pragma.c $(CONFIG_H) $(SYSTEM_H) \
 	coretypes.h $(TM_H) $(TREE_H) $(RTL_H) $(C_PRAGMA_H) \
 	$(CPPLIB_H) hard-reg-set.h output.h $(srcdir)/config/mep/mep-protos.h \
 	function.h insn-config.h reload.h $(TARGET_H)
-	$(COMPILER) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
 
 MULTILIB_OPTIONS = mel mall-opts mfar
 MULTILIB_DIRNAMES = el allopt far