Resistance anomaly of f-electron compounds near pressure-induced magnetic instability